[five-or-more/arnaudb/gtk3: 22/24] Revert "Make on_window_state_event work."
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [five-or-more/arnaudb/gtk3: 22/24] Revert "Make on_window_state_event work."
- Date: Thu, 22 Oct 2020 15:32:55 +0000 (UTC)
commit cf2760b1b78213776a31c5063aa9f588f0516c2e
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Oct 22 17:30:35 2020 +0200
Revert "Make on_window_state_event work."
This reverts commit a02dea100e422d4ad42731e49a001cd91c92e73e.
src/window.vala | 26 ++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 276d1e1..9f6e048 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -74,8 +74,6 @@ private class GameWindow : ApplicationWindow
{
add_action_entries (win_actions, this);
- map.connect (init_state_watcher);
-
SimpleAction theme_action = (SimpleAction) lookup_action ("change-theme");
string theme_value = settings.get_string (FiveOrMoreApp.KEY_THEME);
if (theme_value != "balls.svg" && theme_value != "shapes.svg" && theme_value != "tango.svg") /* TODO
use an enum in GSchema file? */
@@ -127,27 +125,15 @@ private class GameWindow : ApplicationWindow
init_scores_dialog ();
}
- private void init_state_watcher ()
+ protected override bool window_state_event (Gdk.EventWindowState event)
{
- Gdk.Surface? nullable_surface = get_surface (); // TODO report bug, get_surface() returns a
nullable Surface
- if (nullable_surface == null || !((!) nullable_surface is Gdk.Toplevel))
- assert_not_reached ();
- surface = (Gdk.Toplevel) (!) nullable_surface;
- surface.notify ["state"].connect (on_window_state_event);
- }
+ if ((event.changed_mask & Gdk.WindowState.MAXIMIZED) != 0)
+ window_maximized = (event.new_window_state & Gdk.WindowState.MAXIMIZED) != 0;
- private Gdk.Toplevel surface;
- private const Gdk.ToplevelState tiled_state = Gdk.ToplevelState.TILED
- | Gdk.ToplevelState.TOP_TILED
- | Gdk.ToplevelState.BOTTOM_TILED
- | Gdk.ToplevelState.LEFT_TILED
- | Gdk.ToplevelState.RIGHT_TILED;
- private inline void on_window_state_event ()
- {
- Gdk.ToplevelState state = surface.get_state ();
+ if ((event.changed_mask & Gdk.WindowState.TILED) != 0)
+ window_tiled = (event.new_window_state & Gdk.WindowState.TILED) != 0;
- window_maximized = (state & Gdk.ToplevelState.MAXIMIZED) != 0;
- window_tiled = (state & tiled_state) != 0;
+ return false;
}
protected override void size_allocate (Allocation allocation)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]