all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
To: 36250@debbugs.gnu.org
Subject: bug#36250: [PATCH v3] Allow Emacs to be resized arbitrarily
Date: Sun, 16 Jun 2019 21:55:14 +0300	[thread overview]
Message-ID: <20190616185514.23810-1-Hi-Angel@yandex.ru> (raw)
In-Reply-To: <1560707992.19774.0@yandex.ru>

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.
* etc/NEWS: describe changes
---

v3: add description in NEWS file

 etc/NEWS            | 8 ++++++++
 src/emacsgtkfixed.c | 2 --
 src/gtkutil.c       | 9 +--------
 src/xterm.c         | 5 +----
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 723f0a0fb0..e78ac326d0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -171,6 +171,14 @@ This allows disabling the new feature introduced in Emacs 26.1 which
 loads files during completion of 'C-h f' and 'C-h v' according to
 'definition-prefixes'.
 
++++
+** Resize step is not forced anymore
+This should help users of standard-complaint window managers, such as KWin.
+Before this change they couldn't make Emacs full-screen on certain sizes, or
+even make it fill all free space on the screen.
+Users of window managers that ignored that hint, such as i3wm, won't notice
+any change.
+
 \f
 * Changes in Emacs 27.1
 
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






  parent reply	other threads:[~2019-06-16 18:55 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-16 17:59 bug#36250: Allow Emacs to be resized arbitrarily Konstantin Kharlamov
2019-06-16 18:01 ` bug#36250: [PATCH] " Konstantin Kharlamov
2019-06-16 18:24   ` Eli Zaretskii
2019-06-16 18:34     ` Eli Zaretskii
2019-06-17  8:22       ` martin rudalics
2019-06-17  8:41         ` Konstantin Kharlamov
2019-06-17  8:46           ` martin rudalics
2019-06-17  8:58           ` Juanma Barranquero
2019-06-16 18:42     ` Konstantin Kharlamov
2019-06-16 18:53       ` Eli Zaretskii
2019-06-16 18:59         ` Konstantin Kharlamov
2019-06-16 19:07           ` Eli Zaretskii
2019-06-16 19:15             ` Eli Zaretskii
2019-06-16 18:22 ` bug#36250: " Konstantin Kharlamov
2019-06-16 18:22 ` bug#36250: [PATCH v2] " Konstantin Kharlamov
2019-06-16 18:55 ` Konstantin Kharlamov [this message]
2019-06-16 19:10   ` bug#36250: [PATCH v3] " Eli Zaretskii
2019-06-17 12:32     ` Konstantin Kharlamov
2019-06-17 14:56       ` Eli Zaretskii
2019-06-18 20:34         ` Konstantin Kharlamov
2019-06-19 16:13           ` Eli Zaretskii
2020-08-26 10:26       ` Lars Ingebrigtsen
     [not found] ` <mailman.222.1560709505.10840.bug-gnu-emacs@gnu.org>
2019-06-17  7:54   ` bug#36250: [PATCH] " Alan Mackenzie
2019-06-17  8:43     ` martin rudalics
2019-06-17 14:38       ` Eli Zaretskii
2019-06-18  8:17         ` martin rudalics
2019-06-18 15:49           ` Eli Zaretskii
2019-06-17  8:21 ` bug#36250: " martin rudalics
2019-06-17  8:27   ` Konstantin Kharlamov
2019-06-17  8:44     ` martin rudalics
2019-06-17  9:14       ` Konstantin Kharlamov
2019-06-17  9:46         ` martin rudalics
2019-06-17 14:41         ` Eli Zaretskii
2019-06-18 20:35 ` bug#36250: [PATCH] Improve a bit frame-resize-pixelwise documentation Konstantin Kharlamov
2019-06-18 20:38   ` Andreas Schwab
2019-06-19 16:16   ` Eli Zaretskii
2019-06-28 11:27     ` Konstantin Kharlamov
2019-06-28 13:16       ` Eli Zaretskii
2019-06-28 13:59         ` Konstantin Kharlamov
2019-06-28 14:22           ` Eli Zaretskii
2019-06-28 14:34             ` Konstantin Kharlamov
2019-06-28 14:49               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190616185514.23810-1-Hi-Angel@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=36250@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.