all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Florian Rommel <mail@florommel.de>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Support fullscreen values fullheight and fullwidth on pgtk
Date: Thu, 07 Jul 2022 20:52:53 +0200	[thread overview]
Message-ID: <c52891dceba589f8abf9540a646478c7beb59528.camel@florommel.de> (raw)
In-Reply-To: <87sfnhty8v.fsf@yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

On Mon, 2022-07-04 at 10:20 +0800, Po Lu wrote:
> Thanks, now installed.

Unfortunately, I just discrovered that the change causes a problem with
`toggle-frame-fullscreen'.

`toggle-frame-fullscreen' saves the current window state and tries to
restore it.  Because GTK does not support setting fullheight or
fullwidth (and we therefore ignore these values in (set-frame-parameter
'fullscreen)), we cannot change back once the fullscreen state changes
from 'fullheight or 'fullwidth to 'fullboth.

Apart from reverting the commit, we could fix this by setting the
'fullscreen parameter to nil and restoring the frame (this is the
closest to fullheight and fullwidth we can get with gtk), see the
attached patch.


[-- Attachment #2: 0001-Fix-setting-fullscreen-frame-parameter-on-PGTK.patch --]
[-- Type: text/x-patch, Size: 3327 bytes --]

From 19a7e6ee3dfd94f59e58cf2032be91c7faff5b60 Mon Sep 17 00:00:00 2001
From: Florian Rommel <mail@florommel.de>
Date: Thu, 7 Jul 2022 19:37:19 +0200
Subject: [PATCH] Fix setting fullscreen frame parameter on PGTK

This fixes a problem with `toggle-frame-fullscreen' which tries to
reset the previous value of the frame-parameter.

* src/pgtkterm.c (set_fullscreen_state): Set fullscreen parameter to
nil for fullheight and fullwidth.
* doc/lispref/frames.texi (Size Parameters): Update documentation.
---
 doc/lispref/frames.texi | 19 ++++++++++---------
 src/pgtkterm.c          |  9 ++++-----
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index ed56fa777d..52886ada90 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1747,15 +1747,16 @@ Size Parameters
 This parameter specifies whether to maximize the frame's width, height
 or both.  Its value can be @code{fullwidth}, @code{fullheight},
 @code{fullboth}, or @code{maximized}.@footnote{On PGTK frames, setting
-the values @code{fullheight} and @code{fullwidth} has no effect.}  A
-@dfn{fullwidth} frame is as wide as possible, a @dfn{fullheight} frame
-is as tall as possible, and a @dfn{fullboth} frame is both as wide and
-as tall as possible.  A @dfn{maximized} frame is like a ``fullboth''
-frame, except that it usually keeps its title bar and the buttons for
-resizing and closing the frame.  Also, maximized frames typically
-avoid hiding any task bar or panels displayed on the desktop.  A
-``fullboth'' frame, on the other hand, usually omits the title bar and
-occupies the entire available screen space.
+the values @code{fullheight} and @code{fullwidth} resets the parameter
+to nil.}  A @dfn{fullwidth} frame is as wide as possible, a
+@dfn{fullheight} frame is as tall as possible, and a @dfn{fullboth}
+frame is both as wide and as tall as possible.  A @dfn{maximized}
+frame is like a ``fullboth'' frame, except that it usually keeps its
+title bar and the buttons for resizing and closing the frame.  Also,
+maximized frames typically avoid hiding any task bar or panels
+displayed on the desktop.  A ``fullboth'' frame, on the other hand,
+usually omits the title bar and occupies the entire available screen
+space.
 
 Full-height and full-width frames are more similar to maximized
 frames in this regard.  However, these typically display an external
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index b283cef7cd..8e6985df35 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -4401,6 +4401,10 @@ set_fullscreen_state (struct frame *f)
   GtkWindow *widget = GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f));
   switch (f->want_fullscreen)
     {
+    case FULLSCREEN_WIDTH:
+    case FULLSCREEN_HEIGHT:
+      /* Not supported by gtk.
+         Set it to nil instead, to not break `toggle-frame-fullscreen' */
     case FULLSCREEN_NONE:
       gtk_window_unfullscreen (widget);
       gtk_window_unmaximize (widget);
@@ -4418,11 +4422,6 @@ set_fullscreen_state (struct frame *f)
       gtk_window_maximize (widget);
       store_frame_param (f, Qfullscreen, Qmaximized);
       break;
-
-    case FULLSCREEN_WIDTH:
-    case FULLSCREEN_HEIGHT:
-      /* Not supported by gtk. Ignore them. */
-      break;
     }
 
   f->want_fullscreen = FULLSCREEN_NONE;
-- 
2.37.0


  reply	other threads:[~2022-07-07 18:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 14:57 Support fullscreen values fullheight and fullwidth on pgtk Florian Rommel
2022-06-02  6:00 ` 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 [this message]
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=c52891dceba589f8abf9540a646478c7beb59528.camel@florommel.de \
    --to=mail@florommel.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /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.