bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36250: [PATCH v2] Allow Emacs to be resized arbitrarily


From: Konstantin Kharlamov
Subject: bug#36250: [PATCH v2] Allow Emacs to be resized arbitrarily
Date: Sun, 16 Jun 2019 21:22:32 +0300

This constraint disallows standard compliant window managers to make
Emacs fullscreen on certain screen resolutions (ones that are not
multiple of width_inc and height_inc), or to expand Emacs to fill free
space on the screen (on certain sizes too).

It doesn't seem to do anything useful otherwise; besides some WMs
(like i3wm) just ignore this property anyway.

Fixes bug#36250

* src/xterm.c (x_wm_set_size_hint): don't set width_inc, height_inc, and
  GDK_HINT_RESIZE_INC.
* src/gtkutil.c (x_wm_set_size_hint): don't set width_inc, height_inc, and
  PResizeInc.
* src/emacsgtkfixed.c (XSetWMSizeHints): don't set width_inc and height_inc.
---

v2: add "Fixes bug"

 src/emacsgtkfixed.c | 2 --
 src/gtkutil.c       | 9 +--------
 src/xterm.c         | 5 +----
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index 6b2b4f7018..352883a12f 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -222,8 +222,6 @@ XSetWMSizeHints (Display *d,
   data[6] = hints->min_height;
   data[7] = hints->max_width;
   data[8] = hints->max_height;
-  data[9] = hints->width_inc;
-  data[10] = hints->height_inc;
   data[11] = hints->min_aspect.x;
   data[12] = hints->min_aspect.y;
   data[13] = hints->max_aspect.x;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index dccee15925..88ea38b557 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1428,12 +1428,7 @@ x_wm_set_size_hint (struct frame *f, long int flags, 
bool user_position)
 
   size_hints = f->output_data.x->size_hints;
   hint_flags = f->output_data.x->hint_flags;
-
-  hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE;
-  size_hints.width_inc = frame_resize_pixelwise ? 1 : FRAME_COLUMN_WIDTH (f);
-  size_hints.height_inc = frame_resize_pixelwise ? 1 : FRAME_LINE_HEIGHT (f);
-
-  hint_flags |= GDK_HINT_BASE_SIZE;
+  hint_flags |= GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE;
   /* Use one row/col here so base_height/width does not become zero.
      Gtk+ and/or Unity on Ubuntu 12.04 can't handle it.
      Obviously this makes the row/col value displayed off by 1.  */
@@ -1486,8 +1481,6 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool 
user_position)
 
   size_hints.base_width /= scale;
   size_hints.base_height /= scale;
-  size_hints.width_inc /= scale;
-  size_hints.height_inc /= scale;
 
   if (hint_flags != f->output_data.x->hint_flags
       || memcmp (&size_hints,
diff --git a/src/xterm.c b/src/xterm.c
index bc56e99513..cff74e4f22 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12124,7 +12124,7 @@ x_wm_set_size_hint (struct frame *f, long flags, bool 
user_position)
 #endif
 
   /* Setting PMaxSize caused various problems.  */
-  size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */;
+  size_hints.flags = PMinSize /* | PMaxSize */;
 
   size_hints.x = f->left_pos;
   size_hints.y = f->top_pos;
@@ -12132,9 +12132,6 @@ x_wm_set_size_hint (struct frame *f, long flags, bool 
user_position)
   size_hints.width = FRAME_PIXEL_WIDTH (f);
   size_hints.height = FRAME_PIXEL_HEIGHT (f);
 
-  size_hints.width_inc = frame_resize_pixelwise ? 1 : FRAME_COLUMN_WIDTH (f);
-  size_hints.height_inc = frame_resize_pixelwise ? 1 : FRAME_LINE_HEIGHT (f);
-
   size_hints.max_width = x_display_pixel_width (FRAME_DISPLAY_INFO (f))
     - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
   size_hints.max_height = x_display_pixel_height (FRAME_DISPLAY_INFO (f))
-- 
2.22.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]