Mercurial > emacs
comparison src/widget.c @ 6464:7f93299356e2
(set_frame_size): Put #if 0 around a lot of useless code.
Compute explicitely the geometry of the toplevel widget.
author | Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr> |
---|---|
date | Tue, 22 Mar 1994 14:38:10 +0000 |
parents | 888f7465fd94 |
children | 0bd909cf75c3 |
comparison
equal
deleted
inserted
replaced
6463:380e8fcde9a2 | 6464:7f93299356e2 |
---|---|
305 int flags = 0; | 305 int flags = 0; |
306 | 306 |
307 Widget wmshell = get_wm_shell ((Widget) ew); | 307 Widget wmshell = get_wm_shell ((Widget) ew); |
308 Widget app_shell = XtParent ((Widget) wmshell); | 308 Widget app_shell = XtParent ((Widget) wmshell); |
309 | 309 |
310 | |
311 if (! XtIsSubclass (wmshell, shellWidgetClass)) abort (); | 310 if (! XtIsSubclass (wmshell, shellWidgetClass)) abort (); |
312 if (! XtIsSubclass (app_shell, shellWidgetClass)) abort (); | 311 if (! XtIsSubclass (app_shell, shellWidgetClass)) abort (); |
313 | 312 |
313 /* We don't need this for the momment. The geometry is computed in | |
314 xfns.c. */ | |
315 #if 0 | |
314 /* If the EmacsFrame doesn't have a geometry but the shell does, | 316 /* If the EmacsFrame doesn't have a geometry but the shell does, |
315 treat that as the geometry of the frame. (Is this bogus? | 317 treat that as the geometry of the frame. (Is this bogus? |
316 I'm not sure.) */ | 318 I'm not sure.) */ |
317 if (ew->emacs_frame.geometry == 0) | 319 if (ew->emacs_frame.geometry == 0) |
318 XtVaGetValues (wmshell, XtNgeometry, &ew->emacs_frame.geometry, 0); | 320 XtVaGetValues (wmshell, XtNgeometry, &ew->emacs_frame.geometry, 0); |
411 w = app_w; | 413 w = app_w; |
412 h = app_h; | 414 h = app_h; |
413 flags |= (app_flags & (WidthValue | HeightValue)); | 415 flags |= (app_flags & (WidthValue | HeightValue)); |
414 } | 416 } |
415 } | 417 } |
416 | 418 #endif /* 0 */ |
417 { | 419 { |
418 struct frame* frame = ew->emacs_frame.frame; | 420 struct frame* frame = ew->emacs_frame.frame; |
419 Dimension pixel_width, pixel_height; | 421 Dimension pixel_width, pixel_height; |
420 char shell_position [32]; | 422 char shell_position [32]; |
421 | 423 |
429 change_frame_size (frame, h, w, 1, 0); | 431 change_frame_size (frame, h, w, 1, 0); |
430 char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height); | 432 char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height); |
431 ew->core.width = pixel_width; | 433 ew->core.width = pixel_width; |
432 ew->core.height = pixel_height; | 434 ew->core.height = pixel_height; |
433 | 435 |
434 | 436 /* Compute the geometry of the toplevel shell because on some platforms |
437 when the geometry is not set, the widget children are resized. */ | |
438 { | |
439 int len; | |
440 char *tem; | |
441 sprintf (shell_position, "=%dx%d", pixel_width, pixel_height); | |
442 len = strlen (shell_position) + 1; | |
443 tem = (char *) xmalloc (len); | |
444 strncpy (tem, shell_position, len); | |
445 XtVaSetValues (wmshell, XtNgeometry, tem, 0); | |
446 } | |
447 | |
448 #if 0 /* We don't need this also. */ | |
435 /* If a position was specified, assign it to the shell widget. | 449 /* If a position was specified, assign it to the shell widget. |
436 (Else WM won't do anything with it.) | 450 (Else WM won't do anything with it.) |
437 */ | 451 */ |
438 if (flags & (XValue | YValue)) | 452 if (flags & (XValue | YValue)) |
439 { | 453 { |
466 mark_shell_size_user_specified (wmshell); | 480 mark_shell_size_user_specified (wmshell); |
467 | 481 |
468 /* Also assign the iconic status of the frame to the Shell, so that | 482 /* Also assign the iconic status of the frame to the Shell, so that |
469 the WM sees it. */ | 483 the WM sees it. */ |
470 XtVaSetValues (wmshell, XtNiconic, ew->emacs_frame.iconic, 0); | 484 XtVaSetValues (wmshell, XtNiconic, ew->emacs_frame.iconic, 0); |
485 #endif /* 0 */ | |
471 } | 486 } |
472 } | 487 } |
473 | 488 |
474 | 489 |
475 static void | 490 static void |