Subject: Re: bug#21317: 25.0.50; frame-resize-pixelwise has no effect (GTK, no window manager)

From: Pip Cet <[email-masked]>
Date: Sun, 23 Aug 2015 19:43:27 +0000

On Sun, Aug 23, 2015 at 5:55 PM, martin rudalics <[email-masked]> wrote:
>> Attached. I feel a bit uneasy about making wm_supports a global
>> symbol, maybe it should be x_wm_supports?
>
> x_wm_supports sounds indeed better.

Patch attached. Still works, too!

>> In any case, please do let
>> me know what else needs changing and I'll be happy to do it.
>
> Everything else is perfect now (IMHO).

Well, let's hope there won't be a flood of bug reports from KWin users.

Thanks again for all your help in this very confusing matter,
Pip
From e4dc0fd8787208488912c9d0e56d83fbcf9c34dd Mon Sep 17 00:00:00 2001
From: Philip <[email-masked]>
Date: Sun, 23 Aug 2015 19:27:09 +0000
Subject: [PATCH 2/2] Rename `wm_supports' to `x_wm_supports'

	* xterm.c (x_wm_supports): Renamed from `wm_supports'.
	(x_ewmh_activate_frame): Adjust for rename.

	* gtkutil.c (x_wm_set_size_hint): Adjust for rename.
---
 src/gtkutil.c | 6 ++----
 src/xterm.c   | 8 ++++----
 src/xterm.h   | 1 +
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/gtkutil.c b/src/gtkutil.c
index 33f2a02..5fc2beb 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -135,8 +135,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 static void update_theme_scrollbar_width (void);
 static void update_theme_scrollbar_height (void);
 
-bool wm_supports (struct frame *f, Atom want_atom);
-
 #define TB_INFO_KEY "xg_frame_tb_info"
 struct xg_frame_tb_info
 {
@@ -1378,8 +1376,8 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
   XSETFRAME (frame, f);
   fs_state = Fframe_parameter (frame, Qfullscreen);
   if ((EQ (fs_state, Qmaximized) || EQ (fs_state, Qfullboth)) &&
-      (wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_wm_state) ||
-       wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_wm_state_fullscreen)))
+      (x_wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_wm_state) ||
+       x_wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_wm_state_fullscreen)))
     {
       /* Don't set hints when maximized or fullscreen.  Apparently KWin and
          Gtk3 don't get along and the frame shrinks (!).
diff --git a/src/xterm.c b/src/xterm.c
index 9139758..7bb2032 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9783,7 +9783,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
    http://freedesktop.org/wiki/Specifications/wm-spec.  */
 
 bool
-wm_supports (struct frame *f, Atom want_atom)
+x_wm_supports (struct frame *f, Atom want_atom)
 {
   Atom actual_type;
   unsigned long actual_size, bytes_remaining;
@@ -9976,7 +9976,7 @@ static bool
 do_ewmh_fullscreen (struct frame *f)
 {
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
-  bool have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state);
+  bool have_net_atom = x_wm_supports (f, dpyinfo->Xatom_net_wm_state);
   int cur;
   bool dummy;
 
@@ -9985,7 +9985,7 @@ do_ewmh_fullscreen (struct frame *f)
   /* Some window managers don't say they support _NET_WM_STATE, but they do say
      they support _NET_WM_STATE_FULLSCREEN.  Try that also.  */
   if (!have_net_atom)
-    have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state_fullscreen);
+    have_net_atom = x_wm_supports (f, dpyinfo->Xatom_net_wm_state_fullscreen);
 
   if (have_net_atom && cur != f->want_fullscreen)
     {
@@ -10579,7 +10579,7 @@ x_ewmh_activate_frame (struct frame *f)
 
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
 
-  if (FRAME_VISIBLE_P (f) && wm_supports (f, dpyinfo->Xatom_net_active_window))
+  if (FRAME_VISIBLE_P (f) && x_wm_supports (f, dpyinfo->Xatom_net_active_window))
     {
       Lisp_Object frame;
       XSETFRAME (frame, f);
diff --git a/src/xterm.h b/src/xterm.h
index 5622344..6165906 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1072,6 +1072,7 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time t)
 }
 
 extern void x_set_sticky (struct frame *, Lisp_Object, Lisp_Object);
+extern bool x_wm_supports (struct frame *, Atom);
 extern void x_wait_for_event (struct frame *, int);
 extern void x_clear_under_internal_border (struct frame *f);
 
-- 
2.5.0