From: Florian Rommel <mail@florommel.de>
To: emacs-devel@gnu.org
Subject: Support fullscreen values fullheight and fullwidth on pgtk
Date: Wed, 01 Jun 2022 16:57:04 +0200 [thread overview]
Message-ID: <b3b884ec3521d4b99535bd7a6c037bd287f42ade.camel@florommel.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]
This is a suggestion to support the values 'fullheight and 'fullwidth
for the fullscreen frame parameter on pgtk.
Background: I undecorate the frame when it is maximized or "tiled" (in
Gnome) to the left or right (-> fullheight, currently not supported on
pgtk - only with the X backend).
The patch uses the GDK_WINDOW_STATE_*_TILED and
GDK_WINDOW_STATE_*_RESIZABLE flags that are available since GTK
3.22.23. A value of 'fullheight is set if the top and the bottom edges
are marked as tiled and not resizable; 'fullwidth is set if the left
and right edges are marked as tiled and not resizable.
So, is the introduced behavior correct? I think it is consistent with
the description in the Emacs manual: "a fullwidth frame is as wide as
possible, a fullheight frame is as tall as possible".
On Gnome, it works as expected. Other desktop environments, such as
KDE, Xfce or tiling window managers don't seem to support the
GTK_WINDOW_STATE_*_{TILED/RESIZABLE} flags, so fullheight and fullwidth
will still never be set there (however, this also seems to be the case
with the Emacs X backend).
Regards,
Flo
[-- Attachment #2: 0001-pgtk-Add-support-for-fullscreen-values-fullheight-an.patch --]
[-- Type: text/x-patch, Size: 2714 bytes --]
From 2ec3ee73cc7ce2a38ed69a938d858bba286aca8a Mon Sep 17 00:00:00 2001
From: Florian Rommel <mail@florommel.de>
Date: Wed, 1 Jun 2022 16:13:21 +0200
Subject: [PATCH] pgtk: Add support for fullscreen values fullheight and
fullwidth
* src/pgtkterm.c (window_state_event): Set fullheight/fullweight
parameter depending on new_window_state
---
src/pgtkterm.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index da958a6664..eee0df979b 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -5420,6 +5420,7 @@ window_state_event (GtkWidget *widget,
gpointer *user_data)
{
struct frame *f = pgtk_any_window_to_frame (event->window_state.window);
+ GdkWindowState new_state = event->window_state.new_window_state;
union buffered_input_event inev;
EVENT_INIT (inev.ie);
@@ -5428,7 +5429,7 @@ window_state_event (GtkWidget *widget,
if (f)
{
- if (event->window_state.new_window_state & GDK_WINDOW_STATE_FOCUSED)
+ if (new_state & GDK_WINDOW_STATE_FOCUSED)
{
if (FRAME_ICONIFIED_P (f))
{
@@ -5444,17 +5445,26 @@ window_state_event (GtkWidget *widget,
}
}
- if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_FULLSCREEN)
+ if (new_state & GDK_WINDOW_STATE_FULLSCREEN)
store_frame_param (f, Qfullscreen, Qfullboth);
- else if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_MAXIMIZED)
+ else if (new_state & GDK_WINDOW_STATE_MAXIMIZED)
store_frame_param (f, Qfullscreen, Qmaximized);
+#if GTK_CHECK_VERSION (3, 22, 23)
+ else if ((new_state & GDK_WINDOW_STATE_TOP_TILED) &&
+ (new_state & GDK_WINDOW_STATE_BOTTOM_TILED) &&
+ !(new_state & GDK_WINDOW_STATE_TOP_RESIZABLE) &&
+ !(new_state & GDK_WINDOW_STATE_BOTTOM_RESIZABLE))
+ store_frame_param (f, Qfullscreen, Qfullheight);
+ else if ((new_state & GDK_WINDOW_STATE_LEFT_TILED) &&
+ (new_state & GDK_WINDOW_STATE_RIGHT_TILED) &&
+ !(new_state & GDK_WINDOW_STATE_LEFT_RESIZABLE) &&
+ !(new_state & GDK_WINDOW_STATE_RIGHT_RESIZABLE))
+ store_frame_param (f, Qfullscreen, Qfullwidth);
+#endif
else
store_frame_param (f, Qfullscreen, Qnil);
- if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_ICONIFIED)
+ if (new_state & GDK_WINDOW_STATE_ICONIFIED)
SET_FRAME_ICONIFIED (f, true);
else
{
@@ -5464,8 +5474,7 @@ window_state_event (GtkWidget *widget,
SET_FRAME_ICONIFIED (f, false);
}
- if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_STICKY)
+ if (new_state & GDK_WINDOW_STATE_STICKY)
store_frame_param (f, Qsticky, Qt);
else
store_frame_param (f, Qsticky, Qnil);
--
2.36.1
next reply other threads:[~2022-06-01 14:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-01 14:57 Florian Rommel [this message]
2022-06-02 6:00 ` Support fullscreen values fullheight and fullwidth on pgtk Po Lu
2022-06-03 8:11 ` Florian Rommel
2022-06-03 8:23 ` Po Lu
2022-06-03 18:42 ` Florian Rommel
2022-06-04 1:17 ` Po Lu
2022-06-04 14:03 ` Florian Rommel
2022-06-05 1:06 ` Po Lu
2022-06-05 5:41 ` Eli Zaretskii
2022-06-05 10:41 ` Florian Rommel
2022-07-03 11:08 ` Florian Rommel
2022-07-03 11:37 ` Po Lu
2022-07-03 11:39 ` Florian Rommel
2022-07-04 2:20 ` Po Lu
2022-07-07 18:52 ` Florian Rommel
2022-07-08 2:30 ` Po Lu
2022-07-08 5:49 ` Eli Zaretskii
2022-07-08 6:34 ` Po Lu
2022-07-08 7:10 ` Eli Zaretskii
2022-07-08 7:37 ` Po Lu
2022-07-03 13:17 ` 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=b3b884ec3521d4b99535bd7a6c037bd287f42ade.camel@florommel.de \
--to=mail@florommel.de \
--cc=emacs-devel@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.