[Xfce4-commits] [apps/xfce4-terminal] 01/01: Help some WMs (e.g. openbox) handle terminal size when toggling fullscreen or maximized mode
noreply at xfce.org
noreply at xfce.org
Tue Oct 16 22:57:17 CEST 2018
This is an automated email from the git hooks/post-receive script.
f 2 4 0 4 p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-terminal.
commit b1186b9379d6d90aa2f17f80bf83564c69d0d4ad
Author: Igor <f2404 at yandex.ru>
Date: Tue Oct 16 16:56:28 2018 -0400
Help some WMs (e.g. openbox) handle terminal size when toggling fullscreen or maximized mode
---
terminal/terminal-window.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 809854e..74c7060 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -668,19 +668,26 @@ terminal_window_state_event (GtkWidget *widget,
GdkEventWindowState *event)
{
TerminalWindow *window = TERMINAL_WINDOW (widget);
- gboolean fullscreen;
terminal_return_val_if_fail (TERMINAL_IS_WINDOW (window), FALSE);
- /* update the fullscreen action if the fullscreen state changed by the wm */
- if ((event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) != 0
+ if (((event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) != 0
+ || (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0)
&& gtk_widget_get_visible (widget))
{
- fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
+ gboolean fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
+ gboolean maximized = (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
+
+ /* update the fullscreen action if the fullscreen state changed by the wm */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (window->priv->action_fullscreen)) != fullscreen)
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->priv->action_fullscreen), fullscreen);
G_GNUC_END_IGNORE_DEPRECATIONS
+
+ /* restore the window size after turning fullscreen or maximized mode off
+ see https://bugzilla.xfce.org/show_bug.cgi?id=14765 */
+ if (!fullscreen && !maximized)
+ terminal_window_size_pop (window);
}
if (GTK_WIDGET_CLASS (terminal_window_parent_class)->window_state_event != NULL)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list