summaryrefslogtreecommitdiff
path: root/src/wm-tester/main.c
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2014-07-24 10:37:41 +0400
committerinfirit <[email protected]>2014-11-25 18:06:24 +0100
commitb25395fab6fe9ee38bc0cd359941d0a825d88451 (patch)
treee7b6720a543a00495fae1dd1423d652056bedb03 /src/wm-tester/main.c
parentb8d8e52f0effbf76ff909f88932098d4daf4336e (diff)
downloadmarco-b25395fab6fe9ee38bc0cd359941d0a825d88451.tar.bz2
marco-b25395fab6fe9ee38bc0cd359941d0a825d88451.tar.xz
merge metacity(gtk3) changes
merge metacity(gtk3) changes fix warnings clean up unused variables replace UNUSED_VARIABLE by G_GNUC_UNUSED
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);
}