[gnome-calendar/wip/sadiq: 2/3] window: Reuse window-state-changed callback
- From: Mohammed Sadiq <pksadiq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/wip/sadiq: 2/3] window: Reuse window-state-changed callback
- Date: Wed, 6 Dec 2017 16:10:56 +0000 (UTC)
commit fd3cb3e9b5ca6c8d6ecd437e6a0515f5a9bd93ba
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Wed Dec 6 20:52:31 2017 +0530
window: Reuse window-state-changed callback
window-state-changed signal is already handled in window_state_method.
It is better not to override it again in class_init function.
src/gcal-window.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index c38e3e55..d0c627ea 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -973,6 +973,8 @@ window_state_changed (GtkWidget *widget,
state = (GdkEventWindowState*) event;
active = (state->new_window_state & GDK_WINDOW_STATE_FOCUSED);
+ window->is_maximized = state->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
+
/* update timeout time according to the state */
window->refresh_timeout = (active ? FAST_REFRESH_TIMEOUT : SLOW_REFRESH_TIMEOUT);
@@ -1382,22 +1384,6 @@ gcal_window_configure_event (GtkWidget *widget,
return retval;
}
-static gboolean
-gcal_window_state_event (GtkWidget *widget,
- GdkEventWindowState *event)
-{
- GcalWindow *window;
- gboolean retval;
-
- window = GCAL_WINDOW (widget);
-
- window->is_maximized = gtk_window_is_maximized (GTK_WINDOW (window));
-
- retval = GTK_WIDGET_CLASS (gcal_window_parent_class)->window_state_event (widget, event);
-
- return retval;
-}
-
static void
gcal_window_class_init (GcalWindowClass *klass)
{
@@ -1419,7 +1405,6 @@ gcal_window_class_init (GcalWindowClass *klass)
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->configure_event = gcal_window_configure_event;
- widget_class->window_state_event = gcal_window_state_event;
g_object_class_install_property (
object_class,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]