From 2a50d6456cb50504cbdaadeb12119cfb031bc114 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 29 Sep 2004 20:52:53 +0000 Subject: [PATCH] rework the dialog_show so that the dialog is moved before it's shown, and 2004-09-29 Bastien Nocera * gnome-settings-multimedia-keys.c: (dialog_show): rework the dialog_show so that the dialog is moved before it's shown, and use gdk_display_sync() instead of a event looping to avoid "reentrancy" problems when showing/hiding the dialog in fast successions (Closes: #144490) --- gnome-settings-daemon/ChangeLog | 8 ++++++++ gnome-settings-daemon/gnome-settings-multimedia-keys.c | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gnome-settings-daemon/ChangeLog b/gnome-settings-daemon/ChangeLog index b783bcaea..111c91f04 100644 --- a/gnome-settings-daemon/ChangeLog +++ b/gnome-settings-daemon/ChangeLog @@ -1,3 +1,11 @@ +2004-09-29 Bastien Nocera + + * gnome-settings-multimedia-keys.c: (dialog_show): rework the + dialog_show so that the dialog is moved before it's shown, and + use gdk_display_sync() instead of a event looping to avoid + "reentrancy" problems when showing/hiding the dialog in fast + successions (Closes: #144490) + 2004-09-29 Bastien Nocera * actions/acme-volume-gstreamer.c: (acme_volume_gstreamer_init): diff --git a/gnome-settings-daemon/gnome-settings-multimedia-keys.c b/gnome-settings-daemon/gnome-settings-multimedia-keys.c index 194ea3fb6..d3ac9b599 100644 --- a/gnome-settings-daemon/gnome-settings-multimedia-keys.c +++ b/gnome-settings-daemon/gnome-settings-multimedia-keys.c @@ -539,13 +539,11 @@ dialog_show (Acme *acme) x = ((screen_w - orig_w) / 2) + geometry.x; y = geometry.y + (screen_h / 2) + (screen_h / 2 - orig_h) / 2; + gtk_window_move (GTK_WINDOW (acme->dialog), x, y); + gtk_widget_show (acme->dialog); - gdk_window_move (GTK_WIDGET (acme->dialog)->window, x, y); - - /* this makes sure the dialog is actually shown */ - while (gtk_events_pending()) - gtk_main_iteration(); + gdk_display_sync (gdk_screen_get_display (acme->current_screen)); acme->dialog_timeout = gtk_timeout_add (DIALOG_TIMEOUT, (GtkFunction) dialog_hide, acme);