* widget.c (update_wm_hints): Return if wmshell is null.
authorJan Djärv <jan.h.d@swipnet.se>
Sat, 3 Dec 2011 19:15:20 +0000 (20:15 +0100)
committerJan Djärv <jan.h.d@swipnet.se>
Sat, 3 Dec 2011 19:15:20 +0000 (20:15 +0100)
(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
src/widget.c
src/widget.h
src/xterm.c

index 61b4459..6a13bd8 100644 (file)
@@ -1,3 +1,13 @@
+2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * 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  <eliz@gnu.org>
 
        * xdisp.c (handle_invisible_prop): If the invisible text ends just
index 181811b..96bfd47 100644 (file)
@@ -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
index b5b4147..11041d5 100644 (file)
@@ -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 */
index e41af2b..290acdd 100644 (file)
@@ -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 */;