From b25395fab6fe9ee38bc0cd359941d0a825d88451 Mon Sep 17 00:00:00 2001 From: Denis Gorodnichev Date: Thu, 24 Jul 2014 10:37:41 +0400 Subject: merge metacity(gtk3) changes merge metacity(gtk3) changes fix warnings clean up unused variables replace UNUSED_VARIABLE by G_GNUC_UNUSED --- src/wm-tester/main.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'src/wm-tester/main.c') 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); } -- cgit v1.2.1