From 19f5c35da85979747f39b0b2f4223dde0938f4cb Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 4 Feb 2011 03:31:48 +0000 Subject: [PATCH] display: Simplify some old GNOME 2.x code There's no need to wait for gtk_dialog_run() now... --- panels/display/xrandr-capplet.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/panels/display/xrandr-capplet.c b/panels/display/xrandr-capplet.c index 345bfe457..62a71ad8d 100644 --- a/panels/display/xrandr-capplet.c +++ b/panels/display/xrandr-capplet.c @@ -2235,6 +2235,8 @@ apply (App *app) GError *error = NULL; GdkWindow *window; + app->apply_button_clicked_timestamp = gtk_get_current_event_time (); + if (!sanitize_and_save_configuration (app)) return; @@ -2433,19 +2435,6 @@ dialog_map_event_cb (GtkWidget *widget, GdkEventAny *event, gpointer data) } -static void -apply_button_clicked_cb (GtkButton *button, gpointer data) -{ - App *app = data; - - /* We simply store the timestamp at which the Apply button was clicked. - * We'll just wait for the dialog to return from gtk_dialog_run(), and - * *then* use the timestamp when applying the RANDR configuration. - */ - - app->apply_button_clicked_timestamp = gtk_get_current_event_time (); -} - static GtkWidget* _gtk_builder_get_widget (GtkBuilder *builder, const gchar *name) { @@ -2562,12 +2551,9 @@ run_application (void) gtk_container_add (GTK_CONTAINER (align), app->area); - app->apply_button = _gtk_builder_get_widget (builder, "apply_button"); - g_signal_connect (app->apply_button, "clicked", - G_CALLBACK (apply_button_clicked_cb), app); - on_screen_changed (app->screen, app); + app->apply_button = _gtk_builder_get_widget (builder, "apply_button"); g_signal_connect_swapped (_gtk_builder_get_widget (builder, "apply_button"), "clicked", G_CALLBACK (apply), app);