From 19a7e6ee3dfd94f59e58cf2032be91c7faff5b60 Mon Sep 17 00:00:00 2001 From: Florian Rommel 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