aboutsummaryrefslogtreecommitdiffstats
path: root/src/widget.c
diff options
context:
space:
mode:
authorPo Lu2022-08-31 10:17:20 +0800
committerPo Lu2022-08-31 10:17:43 +0800
commit136495f178ccd36b23ffc347fe2b6680fd689e34 (patch)
tree4b8836244aae562e984d522fe064ae2b37ade1f5 /src/widget.c
parent5bedef8f87d2103e21342a06c4c1c9d7efe06621 (diff)
downloademacs-136495f178ccd36b23ffc347fe2b6680fd689e34.tar.gz
emacs-136495f178ccd36b23ffc347fe2b6680fd689e34.zip
Gently nudge Xt into always setting size hints
* src/widget.c (update_wm_hints): Force a resource to change every time this function is called. (bug#57475) (EmacsFrameInitialize): Initialize new field. * src/widgetprv.h (EmacsFramePart): New field `size_switch'. * src/xterm.c (x_wm_set_size_hint): Don't change flags if flags is 0.
Diffstat (limited to 'src/widget.c')
-rw-r--r--src/widget.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/widget.c b/src/widget.c
index b125b4caeed..5a75cdaca8e 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -292,18 +292,20 @@ update_wm_hints (Widget wmshell, EmacsFrame ew)
292 base_height = (wmshell->core.height - ew->core.height 292 base_height = (wmshell->core.height - ew->core.height
293 + (rounded_height - (char_height * ch))); 293 + (rounded_height - (char_height * ch)));
294 294
295 /* This is kind of sleazy, but I can't see how else to tell it to 295 /* Ensure that Xt actually sets window manager hint flags specified
296 make it mark the WM_SIZE_HINTS size as user specified. 296 by the caller by making sure XtNminWidth (a relatively harmless
297 */ 297 resource) always changes each time this function is invoked. */
298/* ((WMShellWidget) wmshell)->wm.size_hints.flags |= USSize;*/ 298 ew->emacs_frame.size_switch = !ew->emacs_frame.size_switch;
299 299
300 XtVaSetValues (wmshell, 300 XtVaSetValues (wmshell,
301 XtNbaseWidth, (XtArgVal) base_width, 301 XtNbaseWidth, (XtArgVal) base_width,
302 XtNbaseHeight, (XtArgVal) base_height, 302 XtNbaseHeight, (XtArgVal) base_height,
303 XtNwidthInc, (XtArgVal) (frame_resize_pixelwise ? 1 : cw), 303 XtNwidthInc, (XtArgVal) (frame_resize_pixelwise ? 1 : cw),
304 XtNheightInc, (XtArgVal) (frame_resize_pixelwise ? 1 : ch), 304 XtNheightInc, (XtArgVal) (frame_resize_pixelwise ? 1 : ch),
305 XtNminWidth, (XtArgVal) base_width, 305 XtNminWidth, (XtArgVal) (base_width
306 XtNminHeight, (XtArgVal) base_height, 306 + ew->emacs_frame.size_switch),
307 XtNminHeight, (XtArgVal) (base_height
308 + ew->emacs_frame.size_switch),
307 NULL); 309 NULL);
308} 310}
309 311
@@ -355,6 +357,8 @@ EmacsFrameInitialize (Widget request, Widget new,
355 exit (1); 357 exit (1);
356 } 358 }
357 359
360 ew->emacs_frame.size_switch = 1;
361
358 update_from_various_frame_slots (ew); 362 update_from_various_frame_slots (ew);
359 set_frame_size (ew); 363 set_frame_size (ew);
360} 364}