[gnome-panel/wip/geiger/geometry: 3/7] panel-run-dialog.c: replace deprecated code



commit 123eed057dac526025f26772e1a6658a6b2fdda1
Author: Sebastian Geiger <sbastig gmx net>
Date:   Fri Feb 16 23:26:54 2018 +0100

    panel-run-dialog.c: replace deprecated code

 gnome-panel/panel-run-dialog.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index 490317c..930eaaa 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -1760,9 +1760,10 @@ static void
 panel_run_dialog_setup_entry (PanelRunDialog *dialog,
                              GtkBuilder     *gui)
 {
-       GdkScreen             *screen;
        int                    width_request;
        GtkWidget             *entry;
+       GdkRectangle           geometry;
+       GdkMonitor            *monitor;
        
        dialog->combobox = PANEL_GTK_BUILDER_GET (gui, "comboboxentry");
 
@@ -1774,10 +1775,14 @@ panel_run_dialog_setup_entry (PanelRunDialog *dialog,
        gtk_combo_box_set_entry_text_column
                (GTK_COMBO_BOX (dialog->combobox), 0);
 
-       screen = gtk_window_get_screen (GTK_WINDOW (dialog->run_dialog));
+       monitor = gdk_display_get_primary_monitor(gdk_display_get_default ());
+
+       gdk_monitor_get_geometry (monitor, &geometry);
+       width_request = geometry.width;
+
+       /* 1/4 the width of the first monitor should be a good value */
+       width_request /= 4;
 
-        /* 1/4 the width of the first monitor should be a good value */
-       width_request = panel_multiscreen_width (screen, 0) / 4;
        g_object_set (G_OBJECT (dialog->combobox),
                      "width_request", width_request,
                      NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]