summaryrefslogtreecommitdiff
path: root/src/wm-tester/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm-tester/main.c')
-rw-r--r--src/wm-tester/main.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/wm-tester/main.c b/src/wm-tester/main.c
index f970075f..d757270d 100644
--- a/src/wm-tester/main.c
+++ b/src/wm-tester/main.c
@@ -120,15 +120,19 @@ evil_timeout (gpointer data)
w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- #if GTK_CHECK_VERSION(3, 0, 0)
- #define gtk_widget_set_uposition gtk_window_move
- #endif
-
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_window_move (GTK_WINDOW (w),
+ g_random_int_range (0,
+ gdk_screen_width ()),
+ g_random_int_range (0,
+ gdk_screen_height ()));
+#else
gtk_widget_set_uposition (w,
g_random_int_range (0,
gdk_screen_width ()),
g_random_int_range (0,
gdk_screen_height ()));
+#endif
parent = NULL;
@@ -205,6 +209,9 @@ set_up_icon_windows (void)
GtkWidget *c;
GList *icons;
GdkPixbuf *pix;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ int size = 0;
+#endif
w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
c = gtk_button_new_with_label ("Icon window");
@@ -212,28 +219,43 @@ set_up_icon_windows (void)
icons = NULL;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE_TOOLBAR, NULL, &size);
+ pix = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), "gtk-save", size, 0, NULL);
+#else
pix = gtk_widget_render_icon (w,
GTK_STOCK_SAVE,
GTK_ICON_SIZE_LARGE_TOOLBAR,
NULL);
+#endif
icons = g_list_append (icons, pix);
if (i % 2)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, NULL, &size);
+ pix = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), "gtk-save", size, 0, NULL);
+#else
pix = gtk_widget_render_icon (w,
GTK_STOCK_SAVE,
GTK_ICON_SIZE_DIALOG,
NULL);
+#endif
icons = g_list_append (icons, pix);
}
if (i % 3)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, NULL, &size);
+ pix = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), "gtk-save", size, 0, NULL);
+#else
pix = gtk_widget_render_icon (w,
GTK_STOCK_SAVE,
GTK_ICON_SIZE_MENU,
NULL);
+#endif
icons = g_list_append (icons, pix);
}