From: Pip Cet <pipcet@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 21317@debbugs.gnu.org
Subject: bug#21317: 25.0.50; frame-resize-pixelwise has no effect (GTK, no window manager)
Date: Sun, 23 Aug 2015 14:44:18 +0000 [thread overview]
Message-ID: <CAOqdjBeMAQVVhd848n_uR8cQw0o=SYvOx3PEq2gGtwz9TG72kg@mail.gmail.com> (raw)
In-Reply-To: <55D9D41D.1060605@gmx.at>
[-- Attachment #1: Type: text/plain, Size: 969 bytes --]
On Sun, Aug 23, 2015 at 2:09 PM, martin rudalics <rudalics@gmx.at> wrote:
>> (No, but soon, hopefully.)
>
> Please do that. We might need it.
I sent the email last week, so it's beyond my control :-)
>> I've attached the patch with a suggested ChangeLog entry (though of
>> course you should change it to your own name).
>
> Thinking about this twice: Could you please also send a patch that's
> based on your earlier proposal, namely to "skip the hints in
> maximized/fullscreen state if wm_supports(net_wm_state) ||
> wm_supports(net_wm_state_fullscreen), it might be KWin" and leaves out
> any of the changes I proposed. I think it would be cleaner and not
> change anything for KWin users who apparently are happy with the current
> state of affairs.
Attached. I feel a bit uneasy about making wm_supports a global
symbol, maybe it should be x_wm_supports? In any case, please do let
me know what else needs changing and I'll be happy to do it.
Thanks again!
[-- Attachment #2: 0001-Fix-full-screen-code-when-there-is-no-window-manager.patch --]
[-- Type: text/x-patch, Size: 3653 bytes --]
From 0ee7d8c5b3bb63fbed9264eb3facab010b136ca1 Mon Sep 17 00:00:00 2001
From: Philip <pipcet@gmail.com>
Date: Sun, 23 Aug 2015 14:37:41 +0000
Subject: [PATCH] Fix full-screen code when there is no window manager.
* xterm.c (wm_suppports): Export function.
(x_check_fullscreen): Call `x_wm_set_size_hint', restore
`fullscreen' frame parameter.
* gtkutil.c (x_wm_set_size_hint): Set size hints when running
without a window manager.
---
src/gtkutil.c | 6 +++++-
src/xterm.c | 19 +++++++++++++++++--
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/gtkutil.c b/src/gtkutil.c
index d684cd9..33f2a02 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -135,6 +135,8 @@ 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
{
@@ -1375,7 +1377,9 @@ 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))
+ 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)))
{
/* 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 b7aacfa..9139758 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9782,7 +9782,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
Specification/Extended Window Manager Hints at
http://freedesktop.org/wiki/Specifications/wm-spec. */
-static bool
+bool
wm_supports (struct frame *f, Atom want_atom)
{
Atom actual_type;
@@ -10155,6 +10155,8 @@ x_handle_net_wm_state (struct frame *f, const XPropertyEvent *event)
static void
x_check_fullscreen (struct frame *f)
{
+ Lisp_Object lval = Qnil;
+
if (do_ewmh_fullscreen (f))
return;
@@ -10173,22 +10175,31 @@ x_check_fullscreen (struct frame *f)
switch (f->want_fullscreen)
{
/* No difference between these two when there is no WM */
- case FULLSCREEN_BOTH:
case FULLSCREEN_MAXIMIZED:
+ lval = Qmaximized;
+ width = x_display_pixel_width (dpyinfo);
+ height = x_display_pixel_height (dpyinfo);
+ break;
+ case FULLSCREEN_BOTH:
+ lval = Qfullboth;
width = x_display_pixel_width (dpyinfo);
height = x_display_pixel_height (dpyinfo);
break;
case FULLSCREEN_WIDTH:
+ lval = Qfullwidth;
width = x_display_pixel_width (dpyinfo);
height = height + FRAME_MENUBAR_HEIGHT (f);
break;
case FULLSCREEN_HEIGHT:
+ lval = Qfullheight;
height = x_display_pixel_height (dpyinfo);
}
frame_size_history_add
(f, Qx_check_fullscreen, width, height, Qnil);
+ x_wm_set_size_hint (f, 0, false);
+
XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
width, height);
@@ -10201,6 +10212,10 @@ x_check_fullscreen (struct frame *f)
x_sync (f);
}
}
+
+ /* `x_net_wm_state' might have reset the fullscreen frame parameter,
+ restore it. */
+ store_frame_param (f, Qfullscreen, lval);
}
/* This function is called by x_set_offset to determine whether the window
--
2.5.0
next prev parent reply other threads:[~2015-08-23 14:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-21 22:34 bug#21317: 25.0.50; frame-resize-pixelwise has no effect (GTK, no window manager) Pip Cet
2015-08-22 6:40 ` martin rudalics
2015-08-22 10:50 ` Pip Cet
2015-08-22 14:16 ` martin rudalics
2015-08-22 15:32 ` Pip Cet
2015-08-22 17:46 ` martin rudalics
2015-08-23 9:45 ` Pip Cet
2015-08-23 11:12 ` martin rudalics
2015-08-23 12:20 ` Pip Cet
2015-08-23 12:29 ` Pip Cet
2015-08-23 13:23 ` martin rudalics
2015-08-23 13:47 ` Pip Cet
2015-08-23 14:09 ` martin rudalics
2015-08-23 14:44 ` Pip Cet [this message]
2015-08-23 17:55 ` martin rudalics
2015-08-23 19:43 ` Pip Cet
2015-08-24 8:17 ` martin rudalics
2015-08-24 10:45 ` Pip Cet
2015-08-23 13:10 ` martin rudalics
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='CAOqdjBeMAQVVhd848n_uR8cQw0o=SYvOx3PEq2gGtwz9TG72kg@mail.gmail.com' \
--to=pipcet@gmail.com \
--cc=21317@debbugs.gnu.org \
--cc=rudalics@gmx.at \
/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.