]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix starting Emacs with -mm or -fs on Haiku
authorPo Lu <luangruo@yahoo.com>
Tue, 22 Mar 2022 02:46:35 +0000 (02:46 +0000)
committerPo Lu <luangruo@yahoo.com>
Tue, 22 Mar 2022 02:46:46 +0000 (02:46 +0000)
* src/haikuterm.c (haiku_set_window_size): Disallow setting the
window size if the frame is fullscreen, like most X window
managers.

src/haikuterm.c

index 221bdfd2ee16752350fa63c0d8ff88c6d33892c4..efaafbfac2020dc2c28ea613a351e3b089eb94d8 100644 (file)
@@ -1835,6 +1835,22 @@ static void
 haiku_set_window_size (struct frame *f, bool change_gravity,
                       int width, int height)
 {
+  Lisp_Object frame;
+
+  /* On X Windows, window managers typically disallow resizing a
+     window when it is fullscreen.  Do the same here.  */
+
+  XSETFRAME (frame, f);
+  if (!NILP (Fframe_parameter (frame, Qfullscreen))
+      /* Only do this if the fullscreen status has actually been
+        applied.  */
+      && f->want_fullscreen == FULLSCREEN_NONE
+      /* And if the configury during frame completion has been
+        completed.  Otherwise, there will be no valid "old size" to
+        go back to.  */
+      && FRAME_OUTPUT_DATA (f)->configury_done)
+    return;
+
   haiku_update_size_hints (f);
 
   if (FRAME_HAIKU_WINDOW (f))