diff options
| author | Karl Heuer | 1995-06-11 20:27:12 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-06-11 20:27:12 +0000 |
| commit | d067ea8b1adb530b42f2a9d99b1adf864ff6efba (patch) | |
| tree | 00c31947e4d76fde61b0664495949307166669b0 /src | |
| parent | cfcd12d6752021ee525325313a8c0c666e3a922e (diff) | |
| download | emacs-d067ea8b1adb530b42f2a9d99b1adf864ff6efba.tar.gz emacs-d067ea8b1adb530b42f2a9d99b1adf864ff6efba.zip | |
Include widget.h.
(x_wm_set_size_hint) [USE_X_TOOLKIT]:
Get the size from the outer widget.
Copy the base and minimum sizes from the old hint.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 65 |
1 files changed, 45 insertions, 20 deletions
diff --git a/src/xterm.c b/src/xterm.c index e9e615acbd5..f4d0fc8e543 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -94,6 +94,7 @@ extern void _XEditResCheckMessages (); | |||
| 94 | #endif | 94 | #endif |
| 95 | 95 | ||
| 96 | #ifdef USE_X_TOOLKIT | 96 | #ifdef USE_X_TOOLKIT |
| 97 | #include "widget.h" | ||
| 97 | #ifndef XtNinitialState | 98 | #ifndef XtNinitialState |
| 98 | #define XtNinitialState "initialState" | 99 | #define XtNinitialState "initialState" |
| 99 | #endif | 100 | #endif |
| @@ -5411,7 +5412,7 @@ x_wm_set_size_hint (f, flags, user_position) | |||
| 5411 | #ifdef USE_X_TOOLKIT | 5412 | #ifdef USE_X_TOOLKIT |
| 5412 | XtSetArg (al[ac], XtNwidth, &widget_width); ac++; | 5413 | XtSetArg (al[ac], XtNwidth, &widget_width); ac++; |
| 5413 | XtSetArg (al[ac], XtNheight, &widget_height); ac++; | 5414 | XtSetArg (al[ac], XtNheight, &widget_height); ac++; |
| 5414 | XtGetValues (f->display.x->column_widget, al, ac); | 5415 | XtGetValues (f->display.x->widget, al, ac); |
| 5415 | size_hints.height = widget_height; | 5416 | size_hints.height = widget_height; |
| 5416 | size_hints.width = widget_width; | 5417 | size_hints.width = widget_width; |
| 5417 | #else /* not USE_X_TOOLKIT */ | 5418 | #else /* not USE_X_TOOLKIT */ |
| @@ -5426,6 +5427,11 @@ x_wm_set_size_hint (f, flags, user_position) | |||
| 5426 | size_hints.max_height | 5427 | size_hints.max_height |
| 5427 | = FRAME_X_DISPLAY_INFO (f)->height - CHAR_TO_PIXEL_HEIGHT (f, 0); | 5428 | = FRAME_X_DISPLAY_INFO (f)->height - CHAR_TO_PIXEL_HEIGHT (f, 0); |
| 5428 | 5429 | ||
| 5430 | /* Calculate the base and minimum sizes. | ||
| 5431 | |||
| 5432 | (When we use the X toolkit, we don't do it here. | ||
| 5433 | Instead we copy the values that the widgets are using, below.) */ | ||
| 5434 | #ifndef USE_X_TOOLKIT | ||
| 5429 | { | 5435 | { |
| 5430 | int base_width, base_height; | 5436 | int base_width, base_height; |
| 5431 | int min_rows = 0, min_cols = 0; | 5437 | int min_rows = 0, min_cols = 0; |
| @@ -5457,32 +5463,51 @@ x_wm_set_size_hint (f, flags, user_position) | |||
| 5457 | #endif | 5463 | #endif |
| 5458 | } | 5464 | } |
| 5459 | 5465 | ||
| 5466 | /* If we don't need the old flags, we don't need the old hint at all. */ | ||
| 5460 | if (flags) | 5467 | if (flags) |
| 5461 | size_hints.flags |= flags; | ||
| 5462 | else | ||
| 5463 | { | 5468 | { |
| 5464 | XSizeHints hints; /* Sometimes I hate X Windows... */ | 5469 | size_hints.flags |= flags; |
| 5465 | long supplied_return; | 5470 | goto no_read; |
| 5466 | int value; | 5471 | } |
| 5472 | #endif /* not USE_X_TOOLKIT */ | ||
| 5473 | |||
| 5474 | { | ||
| 5475 | XSizeHints hints; /* Sometimes I hate X Windows... */ | ||
| 5476 | long supplied_return; | ||
| 5477 | int value; | ||
| 5467 | 5478 | ||
| 5468 | #ifdef HAVE_X11R4 | 5479 | #ifdef HAVE_X11R4 |
| 5469 | value = XGetWMNormalHints (FRAME_X_DISPLAY (f), window, &hints, | 5480 | value = XGetWMNormalHints (FRAME_X_DISPLAY (f), window, &hints, |
| 5470 | &supplied_return); | 5481 | &supplied_return); |
| 5471 | #else | 5482 | #else |
| 5472 | value = XGetNormalHints (FRAME_X_DISPLAY (f), window, &hints); | 5483 | value = XGetNormalHints (FRAME_X_DISPLAY (f), window, &hints); |
| 5473 | #endif | 5484 | #endif |
| 5474 | 5485 | ||
| 5475 | if (value == 0) | 5486 | #ifdef USE_X_TOOLKIT |
| 5476 | hints.flags = 0; | 5487 | size_hints.base_height = hints.base_height; |
| 5477 | if (hints.flags & PSize) | 5488 | size_hints.base_width = hints.base_width; |
| 5478 | size_hints.flags |= PSize; | 5489 | size_hints.min_height = hints.min_height; |
| 5479 | if (hints.flags & PPosition) | 5490 | size_hints.min_width = hints.min_width; |
| 5480 | size_hints.flags |= PPosition; | 5491 | #endif |
| 5481 | if (hints.flags & USPosition) | 5492 | |
| 5482 | size_hints.flags |= USPosition; | 5493 | if (flags) |
| 5483 | if (hints.flags & USSize) | 5494 | size_hints.flags |= flags; |
| 5484 | size_hints.flags |= USSize; | 5495 | else |
| 5485 | } | 5496 | { |
| 5497 | if (value == 0) | ||
| 5498 | hints.flags = 0; | ||
| 5499 | if (hints.flags & PSize) | ||
| 5500 | size_hints.flags |= PSize; | ||
| 5501 | if (hints.flags & PPosition) | ||
| 5502 | size_hints.flags |= PPosition; | ||
| 5503 | if (hints.flags & USPosition) | ||
| 5504 | size_hints.flags |= USPosition; | ||
| 5505 | if (hints.flags & USSize) | ||
| 5506 | size_hints.flags |= USSize; | ||
| 5507 | } | ||
| 5508 | } | ||
| 5509 | |||
| 5510 | no_read: | ||
| 5486 | 5511 | ||
| 5487 | #ifdef PWinGravity | 5512 | #ifdef PWinGravity |
| 5488 | size_hints.win_gravity = f->display.x->win_gravity; | 5513 | size_hints.win_gravity = f->display.x->win_gravity; |