[gnome-mahjongg] Do not save size when tiled.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mahjongg] Do not save size when tiled.
- Date: Mon, 2 Feb 2015 03:05:12 +0000 (UTC)
commit 927cddcdef8b5b236e9ac1a01c316e35336872a3
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Jan 31 14:04:36 2015 +0100
Do not save size when tiled.
src/gnome-mahjongg.vala | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-mahjongg.vala b/src/gnome-mahjongg.vala
index e393ecb..e994208 100644
--- a/src/gnome-mahjongg.vala
+++ b/src/gnome-mahjongg.vala
@@ -21,6 +21,7 @@ public class Mahjongg : Gtk.Application
private int window_width;
private int window_height;
private bool is_maximized;
+ private bool is_tiled;
private GameView game_view;
private Gtk.Button pause_button;
@@ -213,7 +214,7 @@ public class Mahjongg : Gtk.Application
private void size_allocate_cb (Gtk.Allocation allocation)
{
- if (is_maximized)
+ if (is_maximized || is_tiled)
return;
window_width = allocation.width;
window_height = allocation.height;
@@ -223,6 +224,9 @@ public class Mahjongg : Gtk.Application
{
if ((event.changed_mask & Gdk.WindowState.MAXIMIZED) != 0)
is_maximized = (event.new_window_state & Gdk.WindowState.MAXIMIZED) != 0;
+ /* We don’t save this state, but track it for saving size allocation */
+ if ((event.changed_mask & Gdk.WindowState.TILED) != 0)
+ is_tiled = (event.new_window_state & Gdk.WindowState.TILED) != 0;
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]