[quadrapassel] Connect to size_allocate.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [quadrapassel] Connect to size_allocate.
- Date: Mon, 2 Feb 2015 04:14:59 +0000 (UTC)
commit 41df48c7a4487b3ab58137caad8f21b096ded28b
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Mon Feb 2 05:10:31 2015 +0100
Connect to size_allocate.
src/quadrapassel.vala | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/quadrapassel.vala b/src/quadrapassel.vala
index cd0f2d6..5885cfb 100644
--- a/src/quadrapassel.vala
+++ b/src/quadrapassel.vala
@@ -105,7 +105,7 @@ public class Quadrapassel : Gtk.Application
window.icon_name = "quadrapassel";
window.set_events (window.get_events () | Gdk.EventMask.KEY_PRESS_MASK |
Gdk.EventMask.KEY_RELEASE_MASK);
window.title = _("Quadrapassel");
- window.configure_event.connect (window_configure_event_cb);
+ window.size_allocate.connect (size_allocate_cb);
window.window_state_event.connect (window_state_event_cb);
window.key_press_event.connect (key_press_event_cb);
window.key_release_event.connect (key_release_event_cb);
@@ -202,15 +202,12 @@ public class Quadrapassel : Gtk.Application
pause_action.set_enabled (false);
}
- private bool window_configure_event_cb (Gdk.EventConfigure event)
+ private void size_allocate_cb (Gtk.Allocation allocation)
{
- if (!is_maximized)
- {
- window_width = event.width;
- window_height = event.height;
- }
-
- return false;
+ if (is_maximized)
+ return;
+ window_width = allocation.width;
+ window_height = allocation.height;
}
private bool window_state_event_cb (Gdk.EventWindowState event)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]