[gtk+] window: Turn gtk_window_set_screen() into gtk_window_set_display()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] window: Turn gtk_window_set_screen() into gtk_window_set_display()
- Date: Tue, 31 Oct 2017 07:26:01 +0000 (UTC)
commit 07164e098a1c9d71ab580912cd7f37020a18c2e7
Author: Benjamin Otte <otte redhat com>
Date: Tue Oct 31 07:41:15 2017 +0100
window: Turn gtk_window_set_screen() into gtk_window_set_display()
And have a priv->display instead of a priv->screen.
Includes turning gtk_menu_set_screen() into gtk_menu_set_display(),
because that function just forwards to its window.
demos/gtk-demo/assistant.c | 4 +-
demos/gtk-demo/builder.c | 4 +-
demos/gtk-demo/button_box.c | 4 +-
demos/gtk-demo/changedisplay.c | 17 +-
demos/gtk-demo/clipboard.c | 4 +-
demos/gtk-demo/colorsel.c | 4 +-
demos/gtk-demo/combobox.c | 4 +-
demos/gtk-demo/cursors.c | 4 +-
demos/gtk-demo/dialog.c | 4 +-
demos/gtk-demo/drawingarea.c | 4 +-
demos/gtk-demo/editable_cells.c | 4 +-
demos/gtk-demo/entry_buffer.c | 4 +-
demos/gtk-demo/entry_completion.c | 4 +-
demos/gtk-demo/filtermodel.c | 4 +-
demos/gtk-demo/fishbowl.c | 4 +-
demos/gtk-demo/flowbox.c | 4 +-
demos/gtk-demo/foreigndrawing.c | 4 +-
demos/gtk-demo/glarea.c | 2 +-
demos/gtk-demo/headerbar.c | 2 +-
demos/gtk-demo/hypertext.c | 4 +-
demos/gtk-demo/iconview.c | 4 +-
demos/gtk-demo/iconview_edit.c | 4 +-
demos/gtk-demo/images.c | 4 +-
demos/gtk-demo/infobar.c | 4 +-
demos/gtk-demo/links.c | 4 +-
demos/gtk-demo/list_store.c | 4 +-
demos/gtk-demo/listbox.c | 4 +-
demos/gtk-demo/markup.c | 4 +-
demos/gtk-demo/menus.c | 4 +-
demos/gtk-demo/modelbutton.c | 4 +-
demos/gtk-demo/panes.c | 4 +-
demos/gtk-demo/pickers.c | 4 +-
demos/gtk-demo/pixbufs.c | 4 +-
demos/gtk-demo/revealer.c | 4 +-
demos/gtk-demo/rotated_text.c | 4 +-
demos/gtk-demo/scale.c | 4 +-
demos/gtk-demo/search_entry.c | 2 +-
demos/gtk-demo/shortcuts.c | 4 +-
demos/gtk-demo/sizegroup.c | 2 +-
demos/gtk-demo/spinbutton.c | 4 +-
demos/gtk-demo/stack.c | 4 +-
demos/gtk-demo/tabs.c | 4 +-
demos/gtk-demo/textview.c | 4 +-
demos/gtk-demo/theming_style_classes.c | 4 +-
demos/gtk-demo/toolpalette.c | 4 +-
demos/gtk-demo/transparent.c | 4 +-
demos/gtk-demo/tree_store.c | 4 +-
demos/gtk-demo/widgetbowl.c | 4 +-
docs/reference/gtk/gtk4-sections.txt | 4 +-
gtk/gtkdnd.c | 8 +-
gtk/gtkentrycompletion.c | 4 +-
gtk/gtkmenu.c | 34 ++--
gtk/gtkmenu.h | 6 +-
gtk/gtkmountoperation.c | 8 +-
gtk/gtktooltip.c | 8 +-
gtk/gtktreeview.c | 8 +-
gtk/gtkwidget.c | 2 +-
gtk/gtkwindow.c | 158 +++++++------------
gtk/gtkwindow.h | 6 +-
gtk/gtkwindowprivate.h | 2 +-
modules/input/gtkimcontextxim.c | 20 ++--
tests/testgtk.c | 272 ++++++++++++++++----------------
tests/testnoscreen.c | 2 +-
testsuite/gtk/window.c | 2 +-
64 files changed, 349 insertions(+), 392 deletions(-)
---
diff --git a/demos/gtk-demo/assistant.c b/demos/gtk-demo/assistant.c
index c39d0b2..f152a47 100644
--- a/demos/gtk-demo/assistant.c
+++ b/demos/gtk-demo/assistant.c
@@ -170,8 +170,8 @@ do_assistant (GtkWidget *do_widget)
gtk_window_set_default_size (GTK_WINDOW (assistant), -1, 300);
- gtk_window_set_screen (GTK_WINDOW (assistant),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (assistant),
+ gtk_widget_get_display (do_widget));
create_page1 (assistant);
create_page2 (assistant);
diff --git a/demos/gtk-demo/builder.c b/demos/gtk-demo/builder.c
index c6fec17..cf293c5 100644
--- a/demos/gtk-demo/builder.c
+++ b/demos/gtk-demo/builder.c
@@ -61,8 +61,8 @@ do_builder (GtkWidget *do_widget)
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "toolbar1"));
diff --git a/demos/gtk-demo/button_box.c b/demos/gtk-demo/button_box.c
index b2000a2..78fb52b 100644
--- a/demos/gtk-demo/button_box.c
+++ b/demos/gtk-demo/button_box.c
@@ -55,8 +55,8 @@ do_button_box (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c
index baa3b36..d04b3e5 100644
--- a/demos/gtk-demo/changedisplay.c
+++ b/demos/gtk-demo/changedisplay.c
@@ -101,17 +101,16 @@ button_release_event_cb (GtkWidget *widget,
* window under the pointer, or NULL, if there is none.
*/
static GtkWidget *
-query_for_toplevel (GdkScreen *screen,
+query_for_toplevel (GdkDisplay *display,
const char *prompt)
{
- GdkDisplay *display = gdk_screen_get_display (screen);
GtkWidget *popup, *label, *frame;
GdkCursor *cursor;
GtkWidget *toplevel = NULL;
GdkDevice *device;
popup = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_window_set_screen (GTK_WINDOW (popup), screen);
+ gtk_window_set_display (GTK_WINDOW (popup), display);
gtk_window_set_modal (GTK_WINDOW (popup), TRUE);
gtk_window_set_position (GTK_WINDOW (popup), GTK_WIN_POS_CENTER);
@@ -144,7 +143,7 @@ query_for_toplevel (GdkScreen *screen,
while (!clicked)
g_main_context_iteration (NULL, TRUE);
- toplevel = find_toplevel_at_pointer (gdk_screen_get_display (screen));
+ toplevel = find_toplevel_at_pointer (display);
if (toplevel == popup)
toplevel = NULL;
}
@@ -162,17 +161,17 @@ query_for_toplevel (GdkScreen *screen,
static void
query_change_display (ChangeDisplayInfo *info)
{
- GdkScreen *screen = gtk_widget_get_screen (info->window);
+ GdkDisplay *display = gtk_widget_get_display (info->window);
GtkWidget *toplevel;
- toplevel = query_for_toplevel (screen,
+ toplevel = query_for_toplevel (display,
"Please select the toplevel\n"
- "to move to the new screen");
+ "to move to the new display");
if (toplevel)
- gtk_window_set_screen (GTK_WINDOW (toplevel), gdk_display_get_default_screen (info->current_display));
+ gtk_window_set_display (GTK_WINDOW (toplevel), info->current_display);
else
- gdk_display_beep (gdk_screen_get_display (screen));
+ gdk_display_beep (display);
}
/* Called when the user clicks on a button in our dialog or
diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c
index d618ede..f0b4154 100644
--- a/demos/gtk-demo/clipboard.c
+++ b/demos/gtk-demo/clipboard.c
@@ -216,8 +216,8 @@ do_clipboard (GtkWidget *do_widget)
GtkClipboard *clipboard;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Clipboard");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c
index bf396dc..2fab268 100644
--- a/demos/gtk-demo/colorsel.c
+++ b/demos/gtk-demo/colorsel.c
@@ -70,8 +70,8 @@ do_colorsel (GtkWidget *do_widget)
color.alpha = 1;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Color Chooser");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c
index bead7d0..5bd5346 100644
--- a/demos/gtk-demo/combobox.c
+++ b/demos/gtk-demo/combobox.c
@@ -311,8 +311,8 @@ do_combobox (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Combo Boxes");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/cursors.c b/demos/gtk-demo/cursors.c
index b9f48d9..1a6e180 100644
--- a/demos/gtk-demo/cursors.c
+++ b/demos/gtk-demo/cursors.c
@@ -81,8 +81,8 @@ do_cursors (GtkWidget *do_widget)
GtkWidget *section;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Cursors");
gtk_window_set_default_size (GTK_WINDOW (window), 500, 500);
diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c
index e9d0b5c..c72b155 100644
--- a/demos/gtk-demo/dialog.c
+++ b/demos/gtk-demo/dialog.c
@@ -105,8 +105,8 @@ do_dialog (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Dialogs and Message Boxes");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c
index 8582ee5..a9bb8b4 100644
--- a/demos/gtk-demo/drawingarea.c
+++ b/demos/gtk-demo/drawingarea.c
@@ -195,8 +195,8 @@ do_drawingarea (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/editable_cells.c b/demos/gtk-demo/editable_cells.c
index 1fd6892..a86d5c6 100644
--- a/demos/gtk-demo/editable_cells.c
+++ b/demos/gtk-demo/editable_cells.c
@@ -346,8 +346,8 @@ do_editable_cells (GtkWidget *do_widget)
GtkTreeModel *numbers_model;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Editable Cells");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/entry_buffer.c b/demos/gtk-demo/entry_buffer.c
index 5fbd4e0..955077e 100644
--- a/demos/gtk-demo/entry_buffer.c
+++ b/demos/gtk-demo/entry_buffer.c
@@ -20,8 +20,8 @@ do_entry_buffer (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Entry Buffer");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/entry_completion.c b/demos/gtk-demo/entry_completion.c
index b9a8183..8742c1f 100644
--- a/demos/gtk-demo/entry_completion.c
+++ b/demos/gtk-demo/entry_completion.c
@@ -46,8 +46,8 @@ do_entry_completion (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Entry Completion");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
diff --git a/demos/gtk-demo/filtermodel.c b/demos/gtk-demo/filtermodel.c
index bbaa1e0..a7f3f55 100644
--- a/demos/gtk-demo/filtermodel.c
+++ b/demos/gtk-demo/filtermodel.c
@@ -124,8 +124,8 @@ do_filtermodel (GtkWidget *do_widget)
builder = gtk_builder_new_from_resource ("/filtermodel/filtermodel.ui");
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/fishbowl.c b/demos/gtk-demo/fishbowl.c
index 4d87655..bd288aa 100644
--- a/demos/gtk-demo/fishbowl.c
+++ b/demos/gtk-demo/fishbowl.c
@@ -160,8 +160,8 @@ do_fishbowl (GtkWidget *do_widget)
gtk_fishbowl_set_use_icons (GTK_FISHBOWL (bowl), TRUE);
info_label = GTK_WIDGET (gtk_builder_get_object (builder, "info_label"));
allow_changes = GTK_WIDGET (gtk_builder_get_object (builder, "changes_allow"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/flowbox.c b/demos/gtk-demo/flowbox.c
index 21cd388..6d599a2 100644
--- a/demos/gtk-demo/flowbox.c
+++ b/demos/gtk-demo/flowbox.c
@@ -720,8 +720,8 @@ do_flowbox (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Flow Box");
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
diff --git a/demos/gtk-demo/foreigndrawing.c b/demos/gtk-demo/foreigndrawing.c
index f2eb91a..9a963f1 100644
--- a/demos/gtk-demo/foreigndrawing.c
+++ b/demos/gtk-demo/foreigndrawing.c
@@ -960,8 +960,8 @@ do_foreigndrawing (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Foreign drawing");
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c
index 68b1a96..eed1e80 100644
--- a/demos/gtk-demo/glarea.c
+++ b/demos/gtk-demo/glarea.c
@@ -390,7 +390,7 @@ create_glarea_window (GtkWidget *do_widget)
int i;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "OpenGL Area");
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
diff --git a/demos/gtk-demo/headerbar.c b/demos/gtk-demo/headerbar.c
index ca5ce43..150ee4a 100644
--- a/demos/gtk-demo/headerbar.c
+++ b/demos/gtk-demo/headerbar.c
@@ -24,7 +24,7 @@ do_headerbar (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
diff --git a/demos/gtk-demo/hypertext.c b/demos/gtk-demo/hypertext.c
index 4de7ed9..e2ca980 100644
--- a/demos/gtk-demo/hypertext.c
+++ b/demos/gtk-demo/hypertext.c
@@ -262,8 +262,8 @@ do_hypertext (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Hypertext");
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/iconview.c b/demos/gtk-demo/iconview.c
index 5303d13..c597472 100644
--- a/demos/gtk-demo/iconview.c
+++ b/demos/gtk-demo/iconview.c
@@ -253,8 +253,8 @@ do_iconview (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Icon View Basics");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/iconview_edit.c b/demos/gtk-demo/iconview_edit.c
index 5fc5575..61c2456 100644
--- a/demos/gtk-demo/iconview_edit.c
+++ b/demos/gtk-demo/iconview_edit.c
@@ -108,8 +108,8 @@ do_iconview_edit (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Editing and Drag-and-Drop");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c
index bf0618a..7f7fdc0 100644
--- a/demos/gtk-demo/images.c
+++ b/demos/gtk-demo/images.c
@@ -329,8 +329,8 @@ do_images (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Images");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/infobar.c b/demos/gtk-demo/infobar.c
index 630e3fe..4538033 100644
--- a/demos/gtk-demo/infobar.c
+++ b/demos/gtk-demo/infobar.c
@@ -54,8 +54,8 @@ do_infobar (GtkWidget *do_widget)
actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/links.c b/demos/gtk-demo/links.c
index dcd7ba5..49edf89 100644
--- a/demos/gtk-demo/links.c
+++ b/demos/gtk-demo/links.c
@@ -53,8 +53,8 @@ do_links (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Links");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/list_store.c b/demos/gtk-demo/list_store.c
index 9422e4d..84b6572 100644
--- a/demos/gtk-demo/list_store.c
+++ b/demos/gtk-demo/list_store.c
@@ -256,8 +256,8 @@ do_list_store (GtkWidget *do_widget)
/* create window, etc */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "List Store");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/listbox.c b/demos/gtk-demo/listbox.c
index fbce986..b20c23a 100644
--- a/demos/gtk-demo/listbox.c
+++ b/demos/gtk-demo/listbox.c
@@ -345,8 +345,8 @@ do_listbox (GtkWidget *do_widget)
avatar_pixbuf_other = gdk_pixbuf_new_from_resource_at_scale ("/listbox/apple-red.png", 32, 32, FALSE,
NULL);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "List Box");
gtk_window_set_default_size (GTK_WINDOW (window),
400, 600);
diff --git a/demos/gtk-demo/markup.c b/demos/gtk-demo/markup.c
index 859bbfd..d24ee51 100644
--- a/demos/gtk-demo/markup.c
+++ b/demos/gtk-demo/markup.c
@@ -53,8 +53,8 @@ do_markup (GtkWidget *do_widget)
GtkWidget *show_source;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/menus.c b/demos/gtk-demo/menus.c
index 32b64cf..d844609 100644
--- a/demos/gtk-demo/menus.c
+++ b/demos/gtk-demo/menus.c
@@ -96,8 +96,8 @@ do_menus (GtkWidget *do_widget)
GtkAccelGroup *accel_group;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Menus");
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/modelbutton.c b/demos/gtk-demo/modelbutton.c
index 045a911..8adbe37 100644
--- a/demos/gtk-demo/modelbutton.c
+++ b/demos/gtk-demo/modelbutton.c
@@ -43,8 +43,8 @@ do_modelbutton (GtkWidget *do_widget)
gtk_builder_add_callback_symbol (builder, "tool_clicked", G_CALLBACK (tool_clicked));
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/panes.c b/demos/gtk-demo/panes.c
index 4f6501c..18c12a6 100644
--- a/demos/gtk-demo/panes.c
+++ b/demos/gtk-demo/panes.c
@@ -135,8 +135,8 @@ do_panes (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/pickers.c b/demos/gtk-demo/pickers.c
index c096169..b921afb 100644
--- a/demos/gtk-demo/pickers.c
+++ b/demos/gtk-demo/pickers.c
@@ -15,8 +15,8 @@ do_pickers (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/pixbufs.c b/demos/gtk-demo/pixbufs.c
index 4f7f4b5..e82dae8 100644
--- a/demos/gtk-demo/pixbufs.c
+++ b/demos/gtk-demo/pixbufs.c
@@ -175,8 +175,8 @@ do_pixbufs (GtkWidget *do_widget)
GError *error;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Pixbufs");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
diff --git a/demos/gtk-demo/revealer.c b/demos/gtk-demo/revealer.c
index 811359e..6d4ee0c 100644
--- a/demos/gtk-demo/revealer.c
+++ b/demos/gtk-demo/revealer.c
@@ -71,8 +71,8 @@ do_revealer (GtkWidget *do_widget)
builder = gtk_builder_new_from_resource ("/revealer/revealer.ui");
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (on_destroy), NULL);
g_object_set_data_full (G_OBJECT (window), "builder", builder, g_object_unref);
diff --git a/demos/gtk-demo/rotated_text.c b/demos/gtk-demo/rotated_text.c
index b39143a..de06f55 100644
--- a/demos/gtk-demo/rotated_text.c
+++ b/demos/gtk-demo/rotated_text.c
@@ -179,8 +179,8 @@ do_rotated_text (GtkWidget *do_widget)
PangoAttrList *attrs;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Rotated Text");
gtk_window_set_default_size (GTK_WINDOW (window), 4 * RADIUS, 2 * RADIUS);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/scale.c b/demos/gtk-demo/scale.c
index 717ba5b..938eb1a 100644
--- a/demos/gtk-demo/scale.c
+++ b/demos/gtk-demo/scale.c
@@ -20,8 +20,8 @@ do_scale (GtkWidget *do_widget)
builder = gtk_builder_new_from_resource ("/scale/scale.ui");
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/search_entry.c b/demos/gtk-demo/search_entry.c
index 27a777c..6d6f1ec 100644
--- a/demos/gtk-demo/search_entry.c
+++ b/demos/gtk-demo/search_entry.c
@@ -229,7 +229,7 @@ do_search_entry (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Search Entry");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/shortcuts.c b/demos/gtk-demo/shortcuts.c
index c3a3483..884431e 100644
--- a/demos/gtk-demo/shortcuts.c
+++ b/demos/gtk-demo/shortcuts.c
@@ -97,8 +97,8 @@ do_shortcuts (GtkWidget *do_widget)
NULL);
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/sizegroup.c b/demos/gtk-demo/sizegroup.c
index d1eb4a0..ad01f1d 100644
--- a/demos/gtk-demo/sizegroup.c
+++ b/demos/gtk-demo/sizegroup.c
@@ -101,7 +101,7 @@ do_sizegroup (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Size Groups");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/spinbutton.c b/demos/gtk-demo/spinbutton.c
index 4386646..310715c 100644
--- a/demos/gtk-demo/spinbutton.c
+++ b/demos/gtk-demo/spinbutton.c
@@ -201,8 +201,8 @@ do_spinbutton (GtkWidget *do_widget)
NULL);
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Spin Buttons");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/stack.c b/demos/gtk-demo/stack.c
index a99e084..d86e485 100644
--- a/demos/gtk-demo/stack.c
+++ b/demos/gtk-demo/stack.c
@@ -20,8 +20,8 @@ do_stack (GtkWidget *do_widget)
builder = gtk_builder_new_from_resource ("/stack/stack.ui");
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/tabs.c b/demos/gtk-demo/tabs.c
index 0361ac3..d1f7887 100644
--- a/demos/gtk-demo/tabs.c
+++ b/demos/gtk-demo/tabs.c
@@ -20,8 +20,8 @@ do_tabs (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Tabs");
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c
index 1e7b726..5a1ff8c 100644
--- a/demos/gtk-demo/textview.c
+++ b/demos/gtk-demo/textview.c
@@ -464,8 +464,8 @@ do_textview (GtkWidget *do_widget)
GtkTextBuffer *buffer;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window),
450, 450);
diff --git a/demos/gtk-demo/theming_style_classes.c b/demos/gtk-demo/theming_style_classes.c
index 0580c01..5981a1e 100644
--- a/demos/gtk-demo/theming_style_classes.c
+++ b/demos/gtk-demo/theming_style_classes.c
@@ -21,8 +21,8 @@ do_theming_style_classes (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/toolpalette.c b/demos/gtk-demo/toolpalette.c
index dd7fe1a..07712e8 100644
--- a/demos/gtk-demo/toolpalette.c
+++ b/demos/gtk-demo/toolpalette.c
@@ -436,8 +436,8 @@ do_toolpalette (GtkWidget *do_widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Tool Palette");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 600);
diff --git a/demos/gtk-demo/transparent.c b/demos/gtk-demo/transparent.c
index 5d87dba..b8d11c2 100644
--- a/demos/gtk-demo/transparent.c
+++ b/demos/gtk-demo/transparent.c
@@ -20,8 +20,8 @@ do_transparent (GtkWidget *do_widget)
GtkWidget *image;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
g_signal_connect (window, "destroy",
diff --git a/demos/gtk-demo/tree_store.c b/demos/gtk-demo/tree_store.c
index a3f1738..976f9fc 100644
--- a/demos/gtk-demo/tree_store.c
+++ b/demos/gtk-demo/tree_store.c
@@ -391,8 +391,8 @@ do_tree_store (GtkWidget *do_widget)
/* create window, etc */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Tree Store");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/widgetbowl.c b/demos/gtk-demo/widgetbowl.c
index 074e00a..3cc3874 100644
--- a/demos/gtk-demo/widgetbowl.c
+++ b/demos/gtk-demo/widgetbowl.c
@@ -160,8 +160,8 @@ do_widgetbowl (GtkWidget *do_widget)
gtk_fishbowl_set_use_icons (GTK_FISHBOWL (bowl), FALSE);
info_label = GTK_WIDGET (gtk_builder_get_object (builder, "info_label"));
allow_changes = GTK_WIDGET (gtk_builder_get_object (builder, "changes_allow"));
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index e9518c9..ebbb6e7 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -1725,7 +1725,7 @@ GtkMenu
GtkArrowPlacement
gtk_menu_new
gtk_menu_new_from_model
-gtk_menu_set_screen
+gtk_menu_set_display
gtk_menu_reorder_child
gtk_menu_attach
gtk_menu_popup_at_rect
@@ -4727,7 +4727,7 @@ gtk_window_set_position
gtk_window_set_transient_for
gtk_window_set_attached_to
gtk_window_set_destroy_with_parent
-gtk_window_set_screen
+gtk_window_set_display
gtk_window_is_active
gtk_window_is_maximized
gtk_window_list_toplevels
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 62f93c3..2518aeb 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -287,7 +287,7 @@ gtk_drag_get_ipc_widget_for_screen (GdkScreen *screen)
else
{
result = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_window_set_screen (GTK_WINDOW (result), screen);
+ gtk_window_set_display (GTK_WINDOW (result), gdk_screen_get_display (screen));
gtk_window_resize (GTK_WINDOW (result), 1, 1);
gtk_window_move (GTK_WINDOW (result), -99, -99);
gtk_widget_show (result);
@@ -1545,13 +1545,13 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context,
if (!info->icon_window)
{
- GdkScreen *screen;
+ GdkDisplay *display;
- screen = gdk_window_get_screen (gdk_drag_context_get_source_window (context));
+ display = gdk_window_get_display (gdk_drag_context_get_source_window (context));
info->icon_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_type_hint (GTK_WINDOW (info->icon_window), GDK_WINDOW_TYPE_HINT_DND);
- gtk_window_set_screen (GTK_WINDOW (info->icon_window), screen);
+ gtk_window_set_display (GTK_WINDOW (info->icon_window), display);
gtk_widget_set_size_request (info->icon_window, 24, 24);
gtk_style_context_remove_class (gtk_widget_get_style_context (info->icon_window), "background");
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 848f687..f14e0a1 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -1655,8 +1655,8 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion)
GTK_WINDOW (completion->priv->popup_window));
}
- gtk_window_set_screen (GTK_WINDOW (completion->priv->popup_window),
- gtk_widget_get_screen (completion->priv->entry));
+ gtk_window_set_display (GTK_WINDOW (completion->priv->popup_window),
+ gtk_widget_get_display (completion->priv->entry));
if (completion->priv->device)
{
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 8c8828c..e03bb77 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1288,15 +1288,15 @@ gtk_menu_finalize (GObject *object)
}
static void
-menu_change_screen (GtkMenu *menu,
- GdkScreen *new_screen)
+menu_change_display (GtkMenu *menu,
+ GdkDisplay *new_display)
{
GtkMenuPrivate *priv = menu->priv;
- if (new_screen == gtk_widget_get_screen (GTK_WIDGET (menu)))
+ if (new_display == gtk_widget_get_display (GTK_WIDGET (menu)))
return;
- gtk_window_set_screen (GTK_WINDOW (priv->toplevel), new_screen);
+ gtk_window_set_display (GTK_WINDOW (priv->toplevel), new_display);
priv->monitor_num = -1;
}
@@ -1305,8 +1305,8 @@ attach_widget_display_changed (GtkWidget *attach_widget,
GdkDisplay *previous_display,
GtkMenu *menu)
{
- if (!g_object_get_data (G_OBJECT (menu), "gtk-menu-explicit-screen"))
- menu_change_screen (menu, gtk_widget_get_screen (attach_widget));
+ if (!g_object_get_data (G_OBJECT (menu), "gtk-menu-explicit-display"))
+ menu_change_display (menu, gtk_widget_get_display (attach_widget));
}
static void
@@ -1700,7 +1700,7 @@ gtk_menu_popup_internal (GtkMenu *menu,
parent_toplevel = NULL;
if (parent_menu_shell)
parent_toplevel = gtk_widget_get_toplevel (parent_menu_shell);
- else if (!g_object_get_data (G_OBJECT (menu), "gtk-menu-explicit-screen"))
+ else if (!g_object_get_data (G_OBJECT (menu), "gtk-menu-explicit-display"))
{
GtkWidget *attach_widget = gtk_menu_get_attach_widget (menu);
if (attach_widget)
@@ -4295,27 +4295,27 @@ gtk_menu_select_item (GtkMenuShell *menu_shell,
}
/**
- * gtk_menu_set_screen:
+ * gtk_menu_set_display:
* @menu: a #GtkMenu
- * @screen: (allow-none): a #GdkScreen, or %NULL if the screen should be
+ * @screen: (allow-none): a #GdkDisplay, or %NULL if the display should be
* determined by the widget the menu is attached to
*
- * Sets the #GdkScreen on which the menu will be displayed.
+ * Sets the #GdkDisplay on which the menu will be displayed.
*
- * Since: 2.2
+ * Since: 3.94
*/
void
-gtk_menu_set_screen (GtkMenu *menu,
- GdkScreen *screen)
+gtk_menu_set_display (GtkMenu *menu,
+ GdkDisplay *display)
{
g_return_if_fail (GTK_IS_MENU (menu));
- g_return_if_fail (screen == NULL || GDK_IS_SCREEN (screen));
+ g_return_if_fail (display == NULL || GDK_IS_DISPLAY (display));
- g_object_set_data (G_OBJECT (menu), I_("gtk-menu-explicit-screen"), screen);
+ g_object_set_data (G_OBJECT (menu), I_("gtk-menu-explicit-display"), display);
- if (screen)
+ if (display)
{
- menu_change_screen (menu, screen);
+ menu_change_display (menu, display);
}
else
{
diff --git a/gtk/gtkmenu.h b/gtk/gtkmenu.h
index 9737c02..0d3493f 100644
--- a/gtk/gtkmenu.h
+++ b/gtk/gtkmenu.h
@@ -224,9 +224,9 @@ void gtk_menu_reorder_child (GtkMenu *menu,
GtkWidget *child,
gint position);
-GDK_AVAILABLE_IN_ALL
-void gtk_menu_set_screen (GtkMenu *menu,
- GdkScreen *screen);
+GDK_AVAILABLE_IN_3_94
+void gtk_menu_set_display (GtkMenu *menu,
+ GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gtk_menu_attach (GtkMenu *menu,
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 0804a71..9b630a1 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -718,7 +718,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
gtk_window_set_modal (window, TRUE);
}
else if (priv->screen)
- gtk_window_set_screen (GTK_WINDOW (dialog), priv->screen);
+ gtk_window_set_display (GTK_WINDOW (dialog), gdk_screen_get_display (priv->screen));
gtk_widget_show (GTK_WIDGET (dialog));
@@ -886,7 +886,7 @@ gtk_mount_operation_ask_question_do_gtk (GtkMountOperation *op,
g_object_notify (G_OBJECT (op), "is-showing");
if (priv->parent_window == NULL && priv->screen)
- gtk_window_set_screen (GTK_WINDOW (dialog), priv->screen);
+ gtk_window_set_display (GTK_WINDOW (dialog), gdk_screen_get_display (priv->screen));
gtk_widget_show (dialog);
g_object_ref (op);
@@ -1430,7 +1430,7 @@ create_show_processes_dialog (GtkMountOperation *op,
g_object_notify (G_OBJECT (op), "is-showing");
if (priv->parent_window == NULL && priv->screen)
- gtk_window_set_screen (GTK_WINDOW (dialog), priv->screen);
+ gtk_window_set_display (GTK_WINDOW (dialog), gdk_screen_get_display (priv->screen));
tree_view = gtk_tree_view_new ();
/* TODO: should use EM's when gtk+ RI patches land */
@@ -1770,7 +1770,7 @@ gtk_mount_operation_set_screen (GtkMountOperation *op,
priv->screen = g_object_ref (screen);
if (priv->dialog)
- gtk_window_set_screen (GTK_WINDOW (priv->dialog), screen);
+ gtk_window_set_display (GTK_WINDOW (priv->dialog), gdk_screen_get_display (screen));
g_object_notify (G_OBJECT (op), "screen");
}
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 5bf8317..6112ef0 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -1051,8 +1051,6 @@ static void
gtk_tooltip_show_tooltip (GdkDisplay *display)
{
gint x, y;
- GdkScreen *screen;
-
GdkWindow *window;
GtkWidget *tooltip_widget;
GtkTooltip *tooltip;
@@ -1101,16 +1099,14 @@ gtk_tooltip_show_tooltip (GdkDisplay *display)
tooltip->current_window = GTK_WINDOW (GTK_TOOLTIP (tooltip)->window);
}
- screen = gtk_widget_get_screen (tooltip_widget);
-
/* FIXME: should use tooltip->current_window iso tooltip->window */
- if (screen != gtk_widget_get_screen (tooltip->window))
+ if (display != gtk_widget_get_display (tooltip->window))
{
g_signal_handlers_disconnect_by_func (display,
gtk_tooltip_display_closed,
tooltip);
- gtk_window_set_screen (GTK_WINDOW (tooltip->window), screen);
+ gtk_window_set_display (GTK_WINDOW (tooltip->window), display);
g_signal_connect (display, "closed",
G_CALLBACK (gtk_tooltip_display_closed), tooltip);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 5291940..7d7051a 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -10752,13 +10752,13 @@ static void
gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view)
{
GtkWidget *frame, *vbox, *toplevel;
- GdkScreen *screen;
+ GdkDisplay *display;
if (tree_view->priv->search_custom_entry_set)
return;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (tree_view));
- screen = gtk_widget_get_screen (GTK_WIDGET (tree_view));
+ display = gtk_widget_get_display (GTK_WIDGET (tree_view));
if (tree_view->priv->search_window != NULL)
{
@@ -10769,13 +10769,13 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view)
gtk_window_group_remove_window (gtk_window_get_group (GTK_WINDOW (tree_view->priv->search_window)),
GTK_WINDOW (tree_view->priv->search_window));
- gtk_window_set_screen (GTK_WINDOW (tree_view->priv->search_window), screen);
+ gtk_window_set_display (GTK_WINDOW (tree_view->priv->search_window), display);
return;
}
tree_view->priv->search_window = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_window_set_screen (GTK_WINDOW (tree_view->priv->search_window), screen);
+ gtk_window_set_display (GTK_WINDOW (tree_view->priv->search_window), display);
if (gtk_window_has_group (GTK_WINDOW (toplevel)))
gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)),
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index cf6e722..e38c8ab 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -9266,7 +9266,7 @@ gtk_widget_get_screen (GtkWidget *widget)
if (_gtk_widget_is_toplevel (toplevel))
{
if (GTK_IS_WINDOW (toplevel))
- return _gtk_window_get_screen (GTK_WINDOW (toplevel));
+ return gdk_display_get_default_screen (gtk_window_get_display (GTK_WINDOW (toplevel)));
else if (GTK_IS_INVISIBLE (toplevel))
return gtk_invisible_get_screen (GTK_INVISIBLE (widget));
}
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 586d76f..804c178 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -188,7 +188,6 @@ struct _GtkWindowPrivate
GtkWindow *transient_parent;
GtkWindowGeometryInfo *geometry_info;
GtkWindowGroup *group;
- GdkScreen *screen;
GdkDisplay *display;
GtkApplication *application;
@@ -309,7 +308,7 @@ enum {
PROP_DESTROY_WITH_PARENT,
PROP_ICON,
PROP_ICON_NAME,
- PROP_SCREEN,
+ PROP_DISPLAY,
PROP_TYPE_HINT,
PROP_SKIP_TASKBAR_HINT,
PROP_SKIP_PAGER_HINT,
@@ -455,8 +454,6 @@ static void gtk_window_transient_parent_realized (GtkWidget *parent,
static void gtk_window_transient_parent_unrealized (GtkWidget *parent,
GtkWidget *window);
-static GdkScreen *gtk_window_check_screen (GtkWindow *window);
-
static GtkWindowGeometryInfo* gtk_window_get_geometry_info (GtkWindow *window,
gboolean create);
@@ -981,11 +978,11 @@ gtk_window_class_init (GtkWindowClass *klass)
NULL,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
- window_props[PROP_SCREEN] =
- g_param_spec_object ("screen",
- P_("Screen"),
- P_("The screen where this window will be displayed"),
- GDK_TYPE_SCREEN,
+ window_props[PROP_DISPLAY] =
+ g_param_spec_object ("display",
+ P_("Display"),
+ P_("The display that will display this window"),
+ GDK_TYPE_DISPLAY,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
window_props[PROP_IS_ACTIVE] =
@@ -1890,7 +1887,7 @@ gtk_window_init (GtkWindow *window)
priv->gravity = GDK_GRAVITY_NORTH_WEST;
priv->decorated = TRUE;
priv->mnemonic_modifier = GDK_MOD1_MASK;
- priv->screen = gdk_screen_get_default ();
+ priv->display = gdk_display_get_default ();
priv->accept_focus = TRUE;
priv->focus_on_map = TRUE;
@@ -1908,10 +1905,9 @@ gtk_window_init (GtkWindow *window)
gtk_window_update_debugging ();
#ifdef GDK_WINDOWING_X11
- if (priv->screen)
- g_signal_connect (gtk_settings_get_for_screen (priv->screen),
- "notify::gtk-application-prefer-dark-theme",
- G_CALLBACK (gtk_window_on_theme_variant_changed), window);
+ g_signal_connect (gtk_settings_get_for_display (priv->display),
+ "notify::gtk-application-prefer-dark-theme",
+ G_CALLBACK (gtk_window_on_theme_variant_changed), window);
#endif
widget_node = gtk_widget_get_css_node (GTK_WIDGET (window));
@@ -2017,8 +2013,8 @@ gtk_window_set_property (GObject *object,
case PROP_ICON_NAME:
gtk_window_set_icon_name (window, g_value_get_string (value));
break;
- case PROP_SCREEN:
- gtk_window_set_screen (window, g_value_get_object (value));
+ case PROP_DISPLAY:
+ gtk_window_set_display (window, g_value_get_object (value));
break;
case PROP_TYPE_HINT:
gtk_window_set_type_hint (window,
@@ -2127,8 +2123,8 @@ gtk_window_get_property (GObject *object,
case PROP_ICON_NAME:
g_value_set_string (value, gtk_window_get_icon_name (window));
break;
- case PROP_SCREEN:
- g_value_set_object (value, priv->screen);
+ case PROP_DISPLAY:
+ g_value_set_object (value, priv->display);
break;
case PROP_IS_ACTIVE:
g_value_set_boolean (value, priv->is_active);
@@ -3358,11 +3354,11 @@ gtk_window_transient_parent_unrealized (GtkWidget *parent,
}
static void
-gtk_window_transient_parent_screen_changed (GtkWindow *parent,
- GParamSpec *pspec,
- GtkWindow *window)
+gtk_window_transient_parent_display_changed (GtkWindow *parent,
+ GParamSpec *pspec,
+ GtkWindow *window)
{
- gtk_window_set_screen (window, parent->priv->screen);
+ gtk_window_set_display (window, parent->priv->display);
}
static void
@@ -3379,7 +3375,7 @@ gtk_window_unset_transient_for (GtkWindow *window)
gtk_window_transient_parent_unrealized,
window);
g_signal_handlers_disconnect_by_func (priv->transient_parent,
- gtk_window_transient_parent_screen_changed,
+ gtk_window_transient_parent_display_changed,
window);
g_signal_handlers_disconnect_by_func (priv->transient_parent,
gtk_widget_destroyed,
@@ -3459,11 +3455,11 @@ gtk_window_set_transient_for (GtkWindow *window,
g_signal_connect (parent, "unrealize",
G_CALLBACK (gtk_window_transient_parent_unrealized),
window);
- g_signal_connect (parent, "notify::screen",
- G_CALLBACK (gtk_window_transient_parent_screen_changed),
+ g_signal_connect (parent, "notify::display",
+ G_CALLBACK (gtk_window_transient_parent_display_changed),
window);
- gtk_window_set_screen (window, parent->priv->screen);
+ gtk_window_set_display (window, parent->priv->display);
if (priv->destroy_with_parent)
connect_parent_destroyed (window);
@@ -4076,10 +4072,8 @@ static gboolean
gtk_window_supports_client_shadow (GtkWindow *window)
{
GdkDisplay *display;
- GdkScreen *screen;
- screen = _gtk_window_get_screen (window);
- display = gdk_screen_get_display (screen);
+ display = window->priv->display;
if (!gdk_display_is_rgba (display))
return FALSE;
@@ -4090,7 +4084,8 @@ gtk_window_supports_client_shadow (GtkWindow *window)
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
- if (!gdk_x11_screen_supports_net_wm_hint (screen, gdk_atom_intern_static_string
("_GTK_FRAME_EXTENTS")))
+ if (!gdk_x11_screen_supports_net_wm_hint (gdk_display_get_default_screen (display),
+ gdk_atom_intern_static_string ("_GTK_FRAME_EXTENTS")))
return FALSE;
}
#endif
@@ -5924,12 +5919,9 @@ gtk_window_finalize (GObject *object)
}
#ifdef GDK_WINDOWING_X11
- if (priv->screen)
- {
- g_signal_handlers_disconnect_by_func (gtk_settings_get_for_screen (priv->screen),
- gtk_window_on_theme_variant_changed,
- window);
- }
+ g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (priv->display),
+ gtk_window_on_theme_variant_changed,
+ window);
#endif
g_free (priv->startup_id);
@@ -8371,22 +8363,21 @@ get_center_monitor_of_window (GtkWindow *window)
* stuff, or we could just be losers and assume you have a row
* or column of monitors.
*/
- display = gdk_screen_get_display (gtk_window_check_screen (window));
+ display = window->priv->display;
return gdk_display_get_monitor (display, gdk_display_get_n_monitors (display) / 2);
}
static GdkMonitor *
get_monitor_containing_pointer (GtkWindow *window)
{
+ GtkWindowPrivate *priv = window->priv;
gint px, py;
- GdkDisplay *display;
GdkDevice *pointer;
- display = gdk_screen_get_display (gtk_window_check_screen (window));
- pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
+ pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (priv->display));
gdk_device_get_position (pointer, NULL, &px, &py);
- return gdk_display_get_monitor_at_point (display, px, py);
+ return gdk_display_get_monitor_at_point (priv->display, px, py);
}
static void
@@ -8462,11 +8453,8 @@ gtk_window_compute_configure_request (GtkWindow *window,
GtkWindowPosition pos;
GtkWidget *parent_widget;
GtkWindowGeometryInfo *info;
- GdkScreen *screen;
int x, y;
- screen = gtk_window_check_screen (window);
-
gtk_window_compute_hints (window, &new_geometry, &new_flags);
gtk_window_compute_configure_request_size (window,
&new_geometry, new_flags,
@@ -8516,7 +8504,6 @@ gtk_window_compute_configure_request (GtkWindow *window,
case GTK_WIN_POS_CENTER_ON_PARENT:
{
- GdkDisplay *display;
GtkAllocation allocation;
GdkWindow *gdk_window;
GdkMonitor *monitor;
@@ -8525,9 +8512,8 @@ gtk_window_compute_configure_request (GtkWindow *window,
g_assert (_gtk_widget_get_mapped (parent_widget)); /* established earlier */
- display = gdk_screen_get_display (screen);
gdk_window = _gtk_widget_get_window (parent_widget);
- monitor = gdk_display_get_monitor_at_window (display, gdk_window);
+ monitor = gdk_display_get_monitor_at_window (priv->display, gdk_window);
gdk_window_get_origin (gdk_window, &ox, &oy);
@@ -8550,16 +8536,14 @@ gtk_window_compute_configure_request (GtkWindow *window,
case GTK_WIN_POS_MOUSE:
{
GdkRectangle area;
- GdkDisplay *display;
GdkDevice *pointer;
GdkMonitor *monitor;
gint px, py;
- display = gdk_screen_get_display (screen);
- pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
+ pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (priv->display));
gdk_device_get_position (pointer, NULL, &px, &py);
- monitor = gdk_display_get_monitor_at_point (display, px, py);
+ monitor = gdk_display_get_monitor_at_point (priv->display, px, py);
x = px - w / 2;
y = py - h / 2;
@@ -9627,7 +9611,7 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window,
priv = window->priv;
widget = GTK_WIDGET (window);
- gtk_window_set_screen (window, screen);
+ gtk_window_set_display (window, gdk_screen_get_display (screen));
priv->initial_fullscreen_monitor = monitor;
priv->fullscreen_initially = TRUE;
@@ -9941,31 +9925,31 @@ gtk_window_begin_move_drag (GtkWindow *window,
}
/**
- * gtk_window_set_screen:
+ * gtk_window_set_display:
* @window: a #GtkWindow.
- * @screen: a #GdkScreen.
+ * @display: a #GdkDisplay.
*
- * Sets the #GdkScreen where the @window is displayed; if
+ * Sets the #GdkDisplay where the @window is displayed; if
* the window is already mapped, it will be unmapped, and
- * then remapped on the new screen.
+ * then remapped on the new display.
*
- * Since: 2.2
+ * Since: 3.94
*/
void
-gtk_window_set_screen (GtkWindow *window,
- GdkScreen *screen)
+gtk_window_set_display (GtkWindow *window,
+ GdkDisplay *display)
{
GtkWindowPrivate *priv;
GtkWidget *widget;
- GdkScreen *previous_screen;
+ GdkDisplay *previous_display;
gboolean was_mapped;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GDK_IS_SCREEN (screen));
+ g_return_if_fail (GDK_IS_DISPLAY (display));
priv = window->priv;
- if (screen == priv->screen)
+ if (display == priv->display)
return;
/* reset initial_fullscreen_monitor since they are relative to the screen */
@@ -9973,7 +9957,7 @@ gtk_window_set_screen (GtkWindow *window,
widget = GTK_WIDGET (window);
- previous_screen = priv->screen;
+ previous_display = priv->display;
was_mapped = _gtk_widget_get_mapped (widget);
@@ -9983,23 +9967,17 @@ gtk_window_set_screen (GtkWindow *window,
gtk_widget_unrealize (widget);
gtk_window_free_key_hash (window);
- priv->screen = screen;
- if (screen != previous_screen)
- {
+ priv->display = display;
#ifdef GDK_WINDOWING_X11
- if (previous_screen)
- {
- g_signal_handlers_disconnect_by_func (gtk_settings_get_for_screen (previous_screen),
- gtk_window_on_theme_variant_changed, window);
- }
- g_signal_connect (gtk_settings_get_for_screen (screen),
- "notify::gtk-application-prefer-dark-theme",
- G_CALLBACK (gtk_window_on_theme_variant_changed), window);
+ g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (previous_display),
+ gtk_window_on_theme_variant_changed, window);
+ g_signal_connect (gtk_settings_get_for_display (display),
+ "notify::gtk-application-prefer-dark-theme",
+ G_CALLBACK (gtk_window_on_theme_variant_changed), window);
#endif
- _gtk_widget_propagate_display_changed (widget, gdk_screen_get_display (previous_screen));
- }
- g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SCREEN]);
+ _gtk_widget_propagate_display_changed (widget, previous_display);
+ g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DISPLAY]);
if (was_mapped)
gtk_widget_map (widget);
@@ -10014,7 +9992,7 @@ gtk_window_set_theme_variant (GtkWindow *window)
GdkWindow *gdk_window;
gboolean dark_theme_requested;
- g_object_get (gtk_settings_get_for_screen (window->priv->screen),
+ g_object_get (gtk_settings_get_for_display (window->priv->display),
"gtk-application-prefer-dark-theme", &dark_theme_requested,
NULL);
@@ -10037,25 +10015,10 @@ gtk_window_on_theme_variant_changed (GtkSettings *settings,
}
#endif
-static GdkScreen *
-gtk_window_check_screen (GtkWindow *window)
-{
- GtkWindowPrivate *priv = window->priv;
-
- if (priv->screen)
- return priv->screen;
- else
- {
- g_warning ("Screen for GtkWindow not set; you must always set\n"
- "a screen for a GtkWindow before using the window");
- return NULL;
- }
-}
-
-GdkScreen *
-_gtk_window_get_screen (GtkWindow *window)
+GdkDisplay *
+gtk_window_get_display (GtkWindow *window)
{
- return window->priv->screen;
+ return window->priv->display;
}
/**
@@ -10315,13 +10278,12 @@ add_to_key_hash (GtkWindow *window,
static GtkKeyHash *
gtk_window_get_key_hash (GtkWindow *window)
{
- GdkScreen *screen = gtk_window_check_screen (window);
GtkKeyHash *key_hash = g_object_get_qdata (G_OBJECT (window), quark_gtk_window_key_hash);
if (key_hash)
return key_hash;
- key_hash = _gtk_key_hash_new (gdk_keymap_get_for_display (gdk_screen_get_display (screen)),
+ key_hash = _gtk_key_hash_new (gdk_keymap_get_for_display (window->priv->display),
(GDestroyNotify)window_key_entry_destroy);
_gtk_window_keys_foreach (window, add_to_key_hash, key_hash);
g_object_set_qdata (G_OBJECT (window), quark_gtk_window_key_hash, key_hash);
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 584e46d..a8ff84b 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -250,9 +250,9 @@ void gtk_window_set_gravity (GtkWindow *window,
GDK_AVAILABLE_IN_ALL
GdkGravity gtk_window_get_gravity (GtkWindow *window);
-GDK_AVAILABLE_IN_ALL
-void gtk_window_set_screen (GtkWindow *window,
- GdkScreen *screen);
+GDK_AVAILABLE_IN_3_94
+void gtk_window_set_display (GtkWindow *window,
+ GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gtk_window_is_active (GtkWindow *window);
diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h
index fc6bde7..7582042 100644
--- a/gtk/gtkwindowprivate.h
+++ b/gtk/gtkwindowprivate.h
@@ -119,7 +119,7 @@ void gtk_window_set_use_subsurface (GtkWindow *window,
void gtk_window_set_hardcoded_window (GtkWindow *window,
GdkWindow *gdk_window);
-GdkScreen *_gtk_window_get_screen (GtkWindow *window);
+GdkDisplay *gtk_window_get_display (GtkWindow *window);
/* Exported handles */
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c
index 3095fcf..0c2c375 100644
--- a/modules/input/gtkimcontextxim.c
+++ b/modules/input/gtkimcontextxim.c
@@ -1619,13 +1619,13 @@ on_status_toplevel_destroy (GtkWidget *toplevel,
* screen for the status window to match.
*/
static void
-on_status_toplevel_notify_screen (GtkWindow *toplevel,
- GParamSpec *pspec,
- StatusWindow *status_window)
+on_status_toplevel_notify_display (GtkWindow *toplevel,
+ GParamSpec *pspec,
+ StatusWindow *status_window)
{
if (status_window->window)
- gtk_window_set_screen (GTK_WINDOW (status_window->window),
- gtk_widget_get_screen (GTK_WIDGET (toplevel)));
+ gtk_window_set_display (GTK_WINDOW (status_window->window),
+ gtk_widget_get_display (GTK_WIDGET (toplevel)));
}
/* Called when the toplevel window is moved; updates the position of
@@ -1675,7 +1675,7 @@ status_window_free (StatusWindow *status_window)
G_CALLBACK (on_status_toplevel_destroy),
status_window);
g_signal_handlers_disconnect_by_func (status_window->toplevel,
- G_CALLBACK (on_status_toplevel_notify_screen),
+ G_CALLBACK (on_status_toplevel_notify_display),
status_window);
g_signal_handlers_disconnect_by_func (status_window->toplevel,
G_CALLBACK (on_status_toplevel_configure),
@@ -1711,8 +1711,8 @@ status_window_get (GtkWidget *toplevel)
g_signal_connect (toplevel, "configure-event",
G_CALLBACK (on_status_toplevel_configure),
status_window);
- g_signal_connect (toplevel, "notify::screen",
- G_CALLBACK (on_status_toplevel_notify_screen),
+ g_signal_connect (toplevel, "notify::display",
+ G_CALLBACK (on_status_toplevel_notify_display),
status_window);
g_object_set_data (G_OBJECT (toplevel), "gtk-im-xim-status-window", status_window);
@@ -1740,8 +1740,8 @@ status_window_make_window (StatusWindow *status_window)
gtk_container_add (GTK_CONTAINER (window), status_label);
- gtk_window_set_screen (GTK_WINDOW (status_window->window),
- gtk_widget_get_screen (status_window->toplevel));
+ gtk_window_set_display (GTK_WINDOW (status_window->window),
+ gtk_widget_get_display (status_window->toplevel));
on_status_toplevel_configure (status_window->toplevel, NULL, status_window);
}
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 66cc0b3..af1ead9 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -323,8 +323,8 @@ create_buttons (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -399,8 +399,8 @@ create_toggle_buttons (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -519,8 +519,8 @@ create_check_buttons (GtkWidget *widget)
GTK_RESPONSE_NONE,
NULL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -582,8 +582,8 @@ create_radio_buttons (GtkWidget *widget)
GTK_RESPONSE_NONE,
NULL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -706,7 +706,7 @@ create_button_box (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (widget));
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
g_signal_connect (window, "destroy",
@@ -890,8 +890,8 @@ create_statusbar (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -999,8 +999,8 @@ create_alpha_widgets (GtkWidget *widget)
GtkWidget *alpha1, *alpha2, *alpha3;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
gtk_window_set_default_size (GTK_WINDOW (window),
450, 450);
@@ -1214,8 +1214,8 @@ void create_labels (GtkWidget *widget)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -1458,8 +1458,8 @@ create_rotated_text (GtkWidget *widget)
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
@@ -1555,8 +1555,8 @@ create_saved_position (GtkWidget *widget)
gtk_window_move (GTK_WINDOW (window), upositionx, upositiony);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
@@ -1651,8 +1651,8 @@ create_pixbuf (GtkWidget *widget)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -1735,8 +1735,8 @@ create_tooltips (GtkWidget *widget)
"GtkWindow::resizable", FALSE,
NULL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
@@ -1839,8 +1839,8 @@ create_image (GtkWidget *widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
/* this is bogus for testing drawing when allocation < request,
* don't copy into real code
@@ -1966,11 +1966,11 @@ create_listbox (GtkWidget *widget)
if (!window)
{
GtkWidget *hbox, *vbox, *scrolled, *scrolled_box, *list, *label, *button;
- GdkScreen *screen = gtk_widget_get_screen (widget);
+ GdkDisplay *display = gtk_widget_get_display (widget);
int i;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window), screen);
+ gtk_window_set_display (GTK_WINDOW (window), display);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -2047,7 +2047,7 @@ create_listbox (GtkWidget *widget)
*/
static GtkWidget*
-create_menu (GdkScreen *screen, gint depth, gint length)
+create_menu (GdkDisplay *display, gint depth, gint length)
{
GtkWidget *menu;
GtkWidget *menuitem;
@@ -2062,7 +2062,7 @@ create_menu (GdkScreen *screen, gint depth, gint length)
return NULL;
menu = gtk_menu_new ();
- gtk_menu_set_screen (GTK_MENU (menu), screen);
+ gtk_menu_set_display (GTK_MENU (menu), display);
group = NULL;
@@ -2096,14 +2096,14 @@ create_menu (GdkScreen *screen, gint depth, gint length)
if (i < 5)
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
- create_menu (screen, depth - 1, 5));
+ create_menu (display , depth - 1, 5));
}
return menu;
}
static GtkWidget*
-create_table_menu (GdkScreen *screen, gint cols, gint rows)
+create_table_menu (GdkDisplay *display, gint cols, gint rows)
{
GtkWidget *menu;
GtkWidget *menuitem;
@@ -2115,7 +2115,7 @@ create_table_menu (GdkScreen *screen, gint cols, gint rows)
int i, j;
menu = gtk_menu_new ();
- gtk_menu_set_screen (GTK_MENU (menu), screen);
+ gtk_menu_set_display (GTK_MENU (menu), display);
j = 0;
@@ -2123,7 +2123,7 @@ create_table_menu (GdkScreen *screen, gint cols, gint rows)
gtk_menu_attach (GTK_MENU (menu), menuitem, 0, cols, j, j + 1);
submenu = gtk_menu_new ();
- gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_set_display (GTK_MENU (submenu), display);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
gtk_widget_show (menuitem);
j++;
@@ -2216,7 +2216,7 @@ create_table_menu (GdkScreen *screen, gint cols, gint rows)
gtk_menu_attach (GTK_MENU (menu), menuitem, 0, cols, j, j + 1);
submenu = gtk_menu_new ();
- gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_set_display (GTK_MENU (submenu), display);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
gtk_widget_show (menuitem);
j++;
@@ -2246,21 +2246,21 @@ create_table_menu (GdkScreen *screen, gint cols, gint rows)
menuitem = gtk_menu_item_new_with_label ("left");
gtk_menu_attach (GTK_MENU (menu), menuitem, 0, 1, j, j + 1);
submenu = gtk_menu_new ();
- gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_set_display (GTK_MENU (submenu), display);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
gtk_widget_show (menuitem);
menuitem = gtk_menu_item_new_with_label ("Empty");
gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 0, 1);
submenu = gtk_menu_new ();
- gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_set_display (GTK_MENU (submenu), display);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
gtk_widget_show (menuitem);
menuitem = gtk_menu_item_new_with_label ("right");
gtk_menu_attach (GTK_MENU (menu), menuitem, 1, 2, j, j + 1);
submenu = gtk_menu_new ();
- gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_set_display (GTK_MENU (submenu), display);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
gtk_widget_show (menuitem);
@@ -2314,11 +2314,11 @@ create_menus (GtkWidget *widget)
GtkWidget *menuitem;
GtkAccelGroup *accel_group;
GtkWidget *image;
- GdkScreen *screen = gtk_widget_get_screen (widget);
+ GdkDisplay *display = gtk_widget_get_display (widget);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window), screen);
+ gtk_window_set_display (GTK_WINDOW (window), display);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -2341,14 +2341,14 @@ create_menus (GtkWidget *widget)
gtk_box_pack_start (GTK_BOX (box1), menubar);
gtk_widget_show (menubar);
- menu = create_menu (screen, 2, 50);
+ menu = create_menu (display, 2, 50);
menuitem = gtk_menu_item_new_with_label ("test\nline2");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
- menu = create_table_menu (screen, 2, 50);
+ menu = create_table_menu (display, 2, 50);
menuitem = gtk_menu_item_new_with_label ("table");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
@@ -2356,7 +2356,7 @@ create_menus (GtkWidget *widget)
gtk_widget_show (menuitem);
menuitem = gtk_menu_item_new_with_label ("foo");
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (screen, 3, 5));
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (display, 3, 5));
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
@@ -2369,7 +2369,7 @@ create_menus (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (box), label);
gtk_container_add (GTK_CONTAINER (box), image);
gtk_container_add (GTK_CONTAINER (menuitem), box);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (screen, 4, 5));
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (display, 4, 5));
gtk_widget_set_hexpand (menuitem, TRUE);
gtk_widget_set_halign (menuitem, GTK_ALIGN_END);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
@@ -2379,7 +2379,7 @@ create_menus (GtkWidget *widget)
gtk_box_pack_start (GTK_BOX (box1), menubar);
gtk_widget_show (menubar);
- menu = create_menu (screen, 2, 10);
+ menu = create_menu (display, 2, 10);
menuitem = gtk_menu_item_new_with_label ("Second menu bar");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
@@ -2390,7 +2390,7 @@ create_menus (GtkWidget *widget)
gtk_box_pack_start (GTK_BOX (box1), box2);
gtk_widget_show (box2);
- menu = create_menu (screen, 1, 5);
+ menu = create_menu (display, 1, 5);
gtk_menu_set_accel_group (GTK_MENU (menu), accel_group);
menuitem = gtk_check_menu_item_new_with_label ("Accelerate Me");
@@ -2499,8 +2499,8 @@ create_key_lookup (GtkWidget *widget)
"_Close", GTK_RESPONSE_CLOSE,
NULL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
/* We have to expand it so the accel labels will draw their labels
*/
@@ -2594,7 +2594,7 @@ cmw_file (GtkWidget *widget, GtkWidget *parent)
"_Open", GTK_RESPONSE_ACCEPT,
"_Cancel", GTK_RESPONSE_CANCEL,
NULL);
- gtk_window_set_screen (GTK_WINDOW (fs), gtk_widget_get_screen (parent));
+ gtk_window_set_display (GTK_WINDOW (fs), gtk_widget_get_display (parent));
gtk_window_set_modal (GTK_WINDOW (fs), TRUE);
g_signal_connect (fs, "destroy",
@@ -2618,8 +2618,8 @@ create_modal_window (GtkWidget *widget)
/* Create modal window (Here you can use any window descendent )*/
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
gtk_window_set_title (GTK_WINDOW(window),"This window is modal");
@@ -2668,8 +2668,8 @@ create_modal_window (GtkWidget *widget)
*/
static void
-make_message_dialog (GdkScreen *screen,
- GtkWidget **dialog,
+make_message_dialog (GdkDisplay *display,
+ GtkWidget **dialog,
GtkMessageType type,
GtkButtonsType buttons,
guint default_response)
@@ -2684,7 +2684,7 @@ make_message_dialog (GdkScreen *screen,
*dialog = gtk_message_dialog_new (NULL, 0, type, buttons,
"This is a message dialog; it can wrap long lines. This is a long line.
La la la. Look this line is wrapped. Blah blah blah blah blah blah. (Note: testgtk has a nonstandard gtkrc
that changes some of the message dialog icons.)");
- gtk_window_set_screen (GTK_WINDOW (*dialog), screen);
+ gtk_window_set_display (GTK_WINDOW (*dialog), display);
g_signal_connect_swapped (*dialog,
"response",
@@ -2708,12 +2708,12 @@ create_message_dialog (GtkWidget *widget)
static GtkWidget *warning = NULL;
static GtkWidget *error = NULL;
static GtkWidget *question = NULL;
- GdkScreen *screen = gtk_widget_get_screen (widget);
+ GdkDisplay *display = gtk_widget_get_display (widget);
- make_message_dialog (screen, &info, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, GTK_RESPONSE_OK);
- make_message_dialog (screen, &warning, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, GTK_RESPONSE_CLOSE);
- make_message_dialog (screen, &error, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK_CANCEL, GTK_RESPONSE_OK);
- make_message_dialog (screen, &question, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, GTK_RESPONSE_NO);
+ make_message_dialog (display, &info, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, GTK_RESPONSE_OK);
+ make_message_dialog (display, &warning, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, GTK_RESPONSE_CLOSE);
+ make_message_dialog (display, &error, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK_CANCEL, GTK_RESPONSE_OK);
+ make_message_dialog (display, &question, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, GTK_RESPONSE_NO);
}
/*
@@ -2778,8 +2778,8 @@ scrolled_windows_remove (GtkWidget *dialog, gint response, GtkWidget *scrollwin)
{
sw_parent = gtk_widget_get_parent (scrollwin);
sw_float_parent = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (sw_float_parent),
- gtk_widget_get_screen (dialog));
+ gtk_window_set_display (GTK_WINDOW (sw_float_parent),
+ gtk_widget_get_display (dialog));
gtk_window_set_default_size (GTK_WINDOW (sw_float_parent), 200, 200);
@@ -2814,8 +2814,8 @@ create_scrolled_windows (GtkWidget *widget)
{
window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -2970,8 +2970,8 @@ create_entry (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -3068,8 +3068,8 @@ create_expander (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -3121,7 +3121,7 @@ size_group_vsize_changed (GtkSpinButton *spin_button,
}
static GtkWidget *
-create_size_group_window (GdkScreen *screen,
+create_size_group_window (GdkDisplay *display,
GtkSizeGroup *master_size_group)
{
GtkWidget *content_area;
@@ -3142,7 +3142,7 @@ create_size_group_window (GdkScreen *screen,
GTK_RESPONSE_NONE,
NULL);
- gtk_window_set_screen (GTK_WINDOW (window), screen);
+ gtk_window_set_display (GTK_WINDOW (window), display);
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
@@ -3243,7 +3243,7 @@ create_size_groups (GtkWidget *widget)
if (!window1)
{
- window1 = create_size_group_window (gtk_widget_get_screen (widget),
+ window1 = create_size_group_window (gtk_widget_get_display (widget),
master_size_group);
g_signal_connect (window1, "destroy",
@@ -3253,7 +3253,7 @@ create_size_groups (GtkWidget *widget)
if (!window2)
{
- window2 = create_size_group_window (gtk_widget_get_screen (widget),
+ window2 = create_size_group_window (gtk_widget_get_display (widget),
master_size_group);
g_signal_connect (window2, "destroy",
@@ -3462,8 +3462,8 @@ create_spins (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -3924,8 +3924,8 @@ create_cursors (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -4057,8 +4057,8 @@ create_color_selection (GtkWidget *widget)
GtkWidget *label;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -4173,8 +4173,8 @@ create_flipping (GtkWidget *widget)
{
window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -4276,8 +4276,8 @@ create_focus (GtkWidget *widget)
GTK_RESPONSE_NONE,
NULL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -4338,8 +4338,8 @@ create_font_selection (GtkWidget *widget)
GtkWidget *label;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -4417,8 +4417,8 @@ create_dialog (GtkWidget *widget)
*/
dialog_window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (dialog_window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (dialog_window),
+ gtk_widget_get_display (widget));
g_signal_connect (dialog_window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -4463,8 +4463,8 @@ screen_display_check (GtkWidget *widget, ScreenDisplaySelection *data)
const gchar *display_name;
GdkDisplay *display;
GtkWidget *dialog;
- GdkScreen *new_screen = NULL;
- GdkScreen *current_screen = gtk_widget_get_screen (widget);
+ GdkDisplay *new_display = NULL;
+ GdkDisplay *current_display = gtk_widget_get_display (widget);
display_name = gtk_entry_get_text (GTK_ENTRY (data->entry));
display = gdk_display_open (display_name);
@@ -4477,7 +4477,7 @@ screen_display_check (GtkWidget *widget, ScreenDisplaySelection *data)
GTK_BUTTONS_OK,
"The display :\n%s\ncannot be opened",
display_name);
- gtk_window_set_screen (GTK_WINDOW (dialog), current_screen);
+ gtk_window_set_display (GTK_WINDOW (dialog), current_display);
gtk_widget_show (dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
@@ -4501,9 +4501,9 @@ screen_display_check (GtkWidget *widget, ScreenDisplaySelection *data)
}
if (!found)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (data->combo), display_name);
- new_screen = gdk_display_get_default_screen (display);
+ new_display = display;
- gtk_window_set_screen (GTK_WINDOW (data->toplevel), new_screen);
+ gtk_window_set_display (GTK_WINDOW (data->toplevel), new_display);
gtk_widget_destroy (data->dialog_window);
}
}
@@ -4521,10 +4521,10 @@ create_display_screen (GtkWidget *widget)
GtkWidget *label_dpy, *applyb, *cancelb;
GtkWidget *bbox;
ScreenDisplaySelection *scr_dpy_data;
- GdkScreen *screen = gtk_widget_get_screen (widget);
+ GdkDisplay *display = gtk_widget_get_display (widget);
window = g_object_new (gtk_window_get_type (),
- "screen", screen,
+ "display", display,
"type", GTK_WINDOW_TOPLEVEL,
"title", "Screen or Display selection",
10, NULL);
@@ -4634,8 +4634,8 @@ create_event_watcher (GtkWidget *widget)
if (!dialog_window)
{
dialog_window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (dialog_window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (dialog_window),
+ gtk_widget_get_display (widget));
g_signal_connect (dialog_window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -4695,8 +4695,8 @@ create_range_controls (GtkWidget *widget)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -5078,8 +5078,8 @@ create_notebook (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -5272,8 +5272,8 @@ create_panes (GtkWidget *widget)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -5361,8 +5361,8 @@ paned_keyboard_window1 (GtkWidget *widget)
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window1), "Basic paned navigation");
- gtk_window_set_screen (GTK_WINDOW (window1),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window1),
+ gtk_widget_get_display (widget));
hpaned1 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (window1), hpaned1);
@@ -5445,8 +5445,8 @@ paned_keyboard_window2 (GtkWidget *widget)
window2 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window2), "\"button 10\" is not inside the horisontal pane");
- gtk_window_set_screen (GTK_WINDOW (window2),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window2),
+ gtk_widget_get_display (widget));
hpaned2 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (window2), hpaned2);
@@ -5506,8 +5506,8 @@ paned_keyboard_window3 (GtkWidget *widget)
g_object_set_data (G_OBJECT (window3), "window3", window3);
gtk_window_set_title (GTK_WINDOW (window3), "Nested panes");
- gtk_window_set_screen (GTK_WINDOW (window3),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window3),
+ gtk_widget_get_display (widget));
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
@@ -5581,8 +5581,8 @@ paned_keyboard_window4 (GtkWidget *widget)
g_object_set_data (G_OBJECT (window4), "window4", window4);
gtk_window_set_title (GTK_WINDOW (window4), "window4");
- gtk_window_set_screen (GTK_WINDOW (window4),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window4),
+ gtk_widget_get_display (widget));
vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window4), vbox3);
@@ -5645,7 +5645,7 @@ create_paned_keyboard_navigation (GtkWidget *widget)
static GtkWidget *window4 = NULL;
if (window1 &&
- (gtk_widget_get_screen (window1) != gtk_widget_get_screen (widget)))
+ (gtk_widget_get_display (window1) != gtk_widget_get_display (widget)))
{
gtk_widget_destroy (window1);
gtk_widget_destroy (window2);
@@ -5728,8 +5728,8 @@ create_wmhints (GtkWidget *widget)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -6045,8 +6045,8 @@ create_window_states (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -6059,8 +6059,8 @@ create_window_states (GtkWidget *widget)
iconified = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (iconified),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (iconified),
+ gtk_widget_get_display (widget));
g_signal_connect_object (iconified, "destroy",
G_CALLBACK (gtk_widget_destroy),
@@ -6073,8 +6073,8 @@ create_window_states (GtkWidget *widget)
normal = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (normal),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (normal),
+ gtk_widget_get_display (widget));
g_signal_connect_object (normal, "destroy",
G_CALLBACK (gtk_widget_destroy),
@@ -6259,8 +6259,8 @@ window_controls (GtkWidget *window)
control_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (control_window),
- gtk_widget_get_screen (window));
+ gtk_window_set_display (GTK_WINDOW (control_window),
+ gtk_widget_get_display (window));
gtk_window_set_title (GTK_WINDOW (control_window), "Size controls");
@@ -6455,8 +6455,8 @@ create_window_sizing (GtkWidget *widget)
GtkWidget *label;
target_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (target_window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (target_window),
+ gtk_widget_get_display (widget));
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "<span foreground=\"purple\"><big>Window being
resized</big></span>\nBlah blah blah blah\nblah blah blah\nblah blah blah blah blah");
gtk_container_add (GTK_CONTAINER (target_window), label);
@@ -6660,8 +6660,8 @@ create_progress_bar (GtkWidget *widget)
{
pdata->window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (pdata->window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (pdata->window),
+ gtk_widget_get_display (widget));
gtk_window_set_resizable (GTK_WINDOW (pdata->window), TRUE);
@@ -7054,8 +7054,8 @@ create_snapshot (GtkWidget *widget)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
data->handler = g_signal_connect (window, "destroy",
G_CALLBACK (destroy_snapshot_data),
@@ -7175,8 +7175,8 @@ create_selection_test (GtkWidget *widget)
{
window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -7329,8 +7329,8 @@ create_scroll_test (GtkWidget *widget)
{
window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -7443,8 +7443,8 @@ create_timeout_test (GtkWidget *widget)
{
window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (destroy_timeout_test),
@@ -7514,8 +7514,8 @@ create_mainloop (GtkWidget *widget)
{
window = gtk_dialog_new ();
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
gtk_window_set_title (GTK_WINDOW (window), "Test Main Loop");
@@ -7594,8 +7594,8 @@ void create_layout (GtkWidget *widget)
gint i, j;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -7941,8 +7941,8 @@ create_native_dialogs (GtkWidget *widget)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
+ gtk_window_set_display (GTK_WINDOW (window),
+ gtk_widget_get_display (widget));
native = gtk_file_chooser_native_new ("Native title",
GTK_WINDOW (window),
diff --git a/tests/testnoscreen.c b/tests/testnoscreen.c
index 99e323c..f6474bb 100644
--- a/tests/testnoscreen.c
+++ b/tests/testnoscreen.c
@@ -39,7 +39,7 @@ int main (int argc, char *argv[])
display = gdk_display_open (NULL);
- gtk_window_set_screen (GTK_WINDOW (window), gdk_display_get_default_screen (display));
+ gtk_window_set_display (GTK_WINDOW (window), display);
gtk_widget_show (window);
diff --git a/testsuite/gtk/window.c b/testsuite/gtk/window.c
index ad0a40c..0558410 100644
--- a/testsuite/gtk/window.c
+++ b/testsuite/gtk/window.c
@@ -186,7 +186,7 @@ test_resize_popup (void)
/* testcase for the dnd window */
window = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_window_set_screen (GTK_WINDOW (window), gdk_screen_get_default ());
+ gtk_window_set_display (GTK_WINDOW (window), gdk_display_get_default ());
gtk_window_resize (GTK_WINDOW (window), 1, 1);
gtk_window_move (GTK_WINDOW (window), -99, -99);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]