[gnome-photos/wip/rishi/fullscreen: 1/5] main-window, mode-controller: Cope better with WM fullscreen events
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/fullscreen: 1/5] main-window, mode-controller: Cope better with WM fullscreen events
- Date: Tue, 6 Oct 2015 16:05:58 +0000 (UTC)
commit 1c09be9acf12ca025dfb99f384a0d8e550501ba8
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Oct 6 16:35:31 2015 +0200
main-window, mode-controller: Cope better with WM fullscreen events
The window manager can fullscreen us at any time. Make that situation
consistent with being fullscreened by our own action.
Original patch from Cosimo Cecchi for gnome-documents.
https://bugzilla.gnome.org/show_bug.cgi?id=725508
src/photos-main-window.c | 10 ++++++++--
src/photos-mode-controller.c | 6 ------
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/photos-main-window.c b/src/photos-main-window.c
index 838f96d..2f9ffc7 100644
--- a/src/photos-main-window.c
+++ b/src/photos-main-window.c
@@ -320,6 +320,7 @@ static gboolean
photos_main_window_window_state_event (GtkWidget *widget, GdkEventWindowState *event)
{
PhotosMainWindow *self = PHOTOS_MAIN_WINDOW (widget);
+ PhotosMainWindowPrivate *priv = self->priv;
GdkWindow *window;
GdkWindowState state;
gboolean maximized;
@@ -331,10 +332,15 @@ photos_main_window_window_state_event (GtkWidget *widget, GdkEventWindowState *e
state = gdk_window_get_state (window);
if (state & GDK_WINDOW_STATE_FULLSCREEN)
- return ret_val;
+ {
+ photos_mode_controller_set_fullscreen (priv->mode_cntrlr, TRUE);
+ return ret_val;
+ }
+
+ photos_mode_controller_set_fullscreen (priv->mode_cntrlr, FALSE);
maximized = (state & GDK_WINDOW_STATE_MAXIMIZED);
- g_settings_set_boolean (self->priv->settings, "window-maximized", maximized);
+ g_settings_set_boolean (priv->settings, "window-maximized", maximized);
return ret_val;
}
diff --git a/src/photos-mode-controller.c b/src/photos-mode-controller.c
index 7ed0608..85a46e4 100644
--- a/src/photos-mode-controller.c
+++ b/src/photos-mode-controller.c
@@ -228,15 +228,9 @@ photos_mode_controller_set_fullscreen (PhotosModeController *self, gboolean full
{
PhotosModeControllerPrivate *priv = self->priv;
- if (priv->mode != PHOTOS_WINDOW_MODE_PREVIEW)
- return;
-
if (priv->fullscreen == fullscreen)
return;
- if (fullscreen && !priv->can_fullscreen)
- return;
-
priv->fullscreen = fullscreen;
g_signal_emit (self, signals[FULLSCREEN_CHANGED], 0, priv->fullscreen);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]