From 841173079ae8a262f0ecbafabf0cdc4ae56dcbb6 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 16 Sep 2004 08:11:13 +0000 Subject: Keep popup position synced with his size requisition. Fix #143585 2004-09-16 Marco Pesenti Gritti * src/ephy-window.c: (update_fullscreen_popup), (screen_size_changed_cb), (fullscreen_popup_size_request_cb), (ephy_window_fullscreen): Keep popup position synced with his size requisition. Fix #143585 --- src/ephy-window.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ephy-window.c b/src/ephy-window.c index e802aa628..9157b19e2 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -412,15 +412,16 @@ ephy_window_get_type (void) } static void -update_exit_fullscreen_popup_position (EphyWindow *window) +update_fullscreen_popup (EphyWindow *window) { GtkWidget *popup = window->priv->exit_fullscreen_popup; - GdkRectangle screen_rect; int popup_width, popup_height; + GdkRectangle screen_rect; g_return_if_fail (popup != NULL); - gtk_window_get_size (GTK_WINDOW (popup), &popup_width, &popup_height); + popup_width = popup->requisition.width; + popup_height = popup->requisition.height; /* FIXME multihead */ gdk_screen_get_monitor_geometry (gdk_screen_get_default (), @@ -446,7 +447,7 @@ static void screen_size_changed_cb (GdkScreen *screen, EphyWindow *window) { - update_exit_fullscreen_popup_position (window); + update_fullscreen_popup (window); } static void @@ -551,6 +552,12 @@ sync_chromes_visibility (EphyWindow *window) g_object_set (G_OBJECT (window->priv->statusbar), "visible", show_statusbar, NULL); } +static void +fullscreen_popup_size_request_cb (GtkWidget *popup, GtkRequisition *req, EphyWindow *window) +{ + update_fullscreen_popup (window); +} + static void ephy_window_fullscreen (EphyWindow *window) { @@ -593,8 +600,10 @@ ephy_window_fullscreen (EphyWindow *window) /* FIXME multihead */ g_signal_connect (gdk_screen_get_default (), "size-changed", G_CALLBACK (screen_size_changed_cb), window); + g_signal_connect (popup, "size_request", + G_CALLBACK (fullscreen_popup_size_request_cb), window); - update_exit_fullscreen_popup_position (window); + update_fullscreen_popup (window); gtk_widget_show (popup); -- cgit v1.2.3