]> www.fi.muni.cz Git - evince.git/commitdiff
[presentation] playing with signals, I need to know that window was moved/resized
authorxbezdick <255993@mail.muni.cz>
Tue, 19 Apr 2011 13:26:42 +0000 (15:26 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:21 +0000 (13:09 +0200)
libview/ev-view-presentation.c

index 3612904ae025cd539d3d5edb2b094cb3a414b739..be8c336c35bf5d96b214ca0d7d91ba150ee8ace5 100644 (file)
@@ -1235,6 +1235,18 @@ ev_view_presentation_motion_notify_event (GtkWidget      *widget,
        return FALSE;
 }
 
+void ev_view_presentation_resize_cb (EvViewPresentation *pview,
+                                                                gpointer data)
+ {
+       GdkScreen                  *screen = gtk_widget_get_screen (GTK_WIDGET(pview));
+       GdkRectangle        monitor;
+       gint                monitor_num;
+
+       monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (GTK_WIDGET(pview)));
+       gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+       g_printf("%d %d\n",monitor.width,monitor.height);
+ }
+
 static gboolean
 init_presentation (GtkWidget *widget)
 {
@@ -1243,6 +1255,10 @@ init_presentation (GtkWidget *widget)
        GdkRectangle        monitor;
        gint                monitor_num;
 
+       g_signal_connect_swapped(G_OBJECT(screen), "size-changed",
+        G_CALLBACK(ev_view_presentation_resize_cb),G_OBJECT(pview));
+
+
        monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
        gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
        pview->monitor_width = monitor.width;