[gnome-panel/wip/geiger/geometry: 1/8] panel-run-dialog.c: replace deprecated code
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/geiger/geometry: 1/8] panel-run-dialog.c: replace deprecated code
- Date: Sat, 17 Feb 2018 13:16:38 +0000 (UTC)
commit bddfd8ebe44f7e2a6749d7ed3d96ceed921e6780
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 | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index 490317c..5ced1c6 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -1760,9 +1760,9 @@ 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,13 +1774,17 @@ 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 ());
+
+ if (!monitor)
+ monitor = gdk_display_get_monitor (gdk_display_get_default (), 0);
+
+ g_assert (monitor);
+
+ gdk_monitor_get_geometry (monitor, &geometry);
- /* 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);
+ /* 1/4 the width of the monitor should be a good value */
+ gtk_widget_set_size_request (dialog->combobox, geometry.width / 4, -1);
g_signal_connect (entry, "key-press-event",
G_CALLBACK (entry_event), dialog);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]