From c052ead41f5a53da9cc32e7697005fac3506a858 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Sat, 3 Dec 2011 20:15:20 +0100 Subject: [PATCH] * widget.c (update_wm_hints): Return if wmshell is null. (widget_update_wm_size_hints): New function. * widget.h (widget_update_wm_size_hints): Declare. * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call widget_update_wm_size_hints. Fixes: debbugs:10104 --- src/ChangeLog | 10 ++++++++++ src/widget.c | 11 +++++++++++ src/widget.h | 1 + src/xterm.c | 8 ++++++++ 4 files changed, 30 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 61b44593062..6a13bd87264 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-12-03 Jan Djärv + + * widget.c (update_wm_hints): Return if wmshell is null. + (widget_update_wm_size_hints): New function. + + * widget.h (widget_update_wm_size_hints): Declare. + + * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call + widget_update_wm_size_hints (Bug#10104). + 2011-12-03 Eli Zaretskii * xdisp.c (handle_invisible_prop): If the invisible text ends just diff --git a/src/widget.c b/src/widget.c index 181811b8369..96bfd4787e9 100644 --- a/src/widget.c +++ b/src/widget.c @@ -476,6 +476,9 @@ update_wm_hints (EmacsFrame ew) int base_height; int min_rows = 0, min_cols = 0; + /* This happens when the frame is just created. */ + if (! wmshell) return; + #if 0 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); #endif @@ -506,6 +509,14 @@ update_wm_hints (EmacsFrame ew) NULL); } +void +widget_update_wm_size_hints (Widget widget) +{ + EmacsFrame ew = (EmacsFrame)widget; + update_wm_hints (ew); +} + + #if 0 static void diff --git a/src/widget.h b/src/widget.h index b5b4147b167..11041d54ad0 100644 --- a/src/widget.h +++ b/src/widget.h @@ -95,5 +95,6 @@ extern struct _DisplayContext* display_context; /* Special entry points */ void EmacsFrameSetCharSize (Widget, int, int); void widget_store_internal_border (Widget widget); +void widget_update_wm_size_hints (Widget widget); #endif /* _EmacsFrame_h */ diff --git a/src/xterm.c b/src/xterm.c index e41af2b2870..290acdd9ca4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9561,6 +9561,14 @@ x_wm_set_size_hint (struct frame *f, long flags, int user_position) XSizeHints size_hints; Window window = FRAME_OUTER_WINDOW (f); +#ifdef USE_X_TOOLKIT + if (f->output_data.x->widget) + { + widget_update_wm_size_hints (f->output_data.x->widget); + return; + } +#endif + /* Setting PMaxSize caused various problems. */ size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */; -- 2.39.2