summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-21 21:14:26 +0300
committermonsta <[email protected]>2016-11-21 21:14:26 +0300
commitd0ddaedffa7d417a699cafce73c1e418515c4a28 (patch)
tree645b7a86e32b21113e1ce14f563bfb8d8900fa53 /mate-panel
parent7dfeb78328039cf92a9f45d64c9b3662d967a1fe (diff)
downloadmate-panel-d0ddaedffa7d417a699cafce73c1e418515c4a28.tar.bz2
mate-panel-d0ddaedffa7d417a699cafce73c1e418515c4a28.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require libmate-desktop >= 1.17 WARNING: use GTK+3 build of libmateweather for this build. that lib is not migrated to GTK+3 only as we will possibly use libgweather instead of it.
Diffstat (limited to 'mate-panel')
-rw-r--r--mate-panel/Makefile.am1
-rw-r--r--mate-panel/applet.c17
-rw-r--r--mate-panel/button-widget.c252
-rw-r--r--mate-panel/libegg/eggsmclient-private.h3
-rw-r--r--mate-panel/libegg/eggsmclient-xsmp.c19
-rw-r--r--mate-panel/libmate-panel-applet-private/panel-applet-container.c2
-rw-r--r--mate-panel/libpanel-util/panel-color.c5
-rw-r--r--mate-panel/libpanel-util/panel-color.h4
-rw-r--r--mate-panel/libpanel-util/panel-icon-chooser.c4
-rw-r--r--mate-panel/libpanel-util/panel-launch.c4
-rw-r--r--mate-panel/libpanel-util/panel-show.h2
-rw-r--r--mate-panel/libpanel-util/panel-xdg.c1
-rw-r--r--mate-panel/libpanel-util/panel-xdg.h2
-rw-r--r--mate-panel/menu.c62
-rw-r--r--mate-panel/menu.h1
-rw-r--r--mate-panel/nothing.cP7
-rw-r--r--mate-panel/nothing.h3
-rw-r--r--mate-panel/panel-action-button.c9
-rw-r--r--mate-panel/panel-action-protocol.c9
-rw-r--r--mate-panel/panel-addto.c8
-rw-r--r--mate-panel/panel-addto.h3
-rw-r--r--mate-panel/panel-applet-frame.c118
-rw-r--r--mate-panel/panel-background-monitor.c117
-rw-r--r--mate-panel/panel-background-monitor.h5
-rw-r--r--mate-panel/panel-background.c490
-rw-r--r--mate-panel/panel-background.h44
-rw-r--r--mate-panel/panel-context-menu.c4
-rw-r--r--mate-panel/panel-ditem-editor.c105
-rw-r--r--mate-panel/panel-force-quit.c41
-rw-r--r--mate-panel/panel-frame.c162
-rw-r--r--mate-panel/panel-frame.h2
-rw-r--r--mate-panel/panel-menu-bar.c55
-rw-r--r--mate-panel/panel-menu-button.c4
-rw-r--r--mate-panel/panel-menu-button.h1
-rw-r--r--mate-panel/panel-menu-items.c3
-rw-r--r--mate-panel/panel-multiscreen.c27
-rw-r--r--mate-panel/panel-profile.c148
-rw-r--r--mate-panel/panel-profile.h15
-rw-r--r--mate-panel/panel-properties-dialog.c93
-rw-r--r--mate-panel/panel-properties-dialog.ui767
-rw-r--r--mate-panel/panel-reset.c2
-rw-r--r--mate-panel/panel-reset.h2
-rw-r--r--mate-panel/panel-run-dialog.c29
-rw-r--r--mate-panel/panel-run-dialog.h2
-rw-r--r--mate-panel/panel-separator.c75
-rw-r--r--mate-panel/panel-session.c6
-rw-r--r--mate-panel/panel-toplevel.c463
-rw-r--r--mate-panel/panel-types.h10
-rw-r--r--mate-panel/panel-util.c8
-rw-r--r--mate-panel/panel-widget.c192
-rw-r--r--mate-panel/panel-xutils.c9
-rw-r--r--mate-panel/panel.c17
-rw-r--r--mate-panel/xstuff.c47
53 files changed, 87 insertions, 3394 deletions
diff --git a/mate-panel/Makefile.am b/mate-panel/Makefile.am
index 61240e1b..ec94421f 100644
--- a/mate-panel/Makefile.am
+++ b/mate-panel/Makefile.am
@@ -224,7 +224,6 @@ BUILT_SOURCES = \
uidir = $(datadir)/mate-panel/ui
ui_DATA = \
- panel-properties-dialog.ui \
panel-properties-dialog-gtk3.ui \
panel-run-dialog.ui \
panel-test-applets.ui
diff --git a/mate-panel/applet.c b/mate-panel/applet.c
index c8b1c95b..51f64086 100644
--- a/mate-panel/applet.c
+++ b/mate-panel/applet.c
@@ -565,7 +565,6 @@ mate_panel_applet_create_menu (AppletInfo *info)
}
/* Set up theme and transparency support */
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *toplevel = gtk_widget_get_toplevel (menu);
/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
@@ -576,7 +575,7 @@ mate_panel_applet_create_menu (AppletInfo *info)
context = gtk_widget_get_style_context (GTK_WIDGET(toplevel));
gtk_style_context_add_class(context,"gnome-panel-menu-bar");
gtk_style_context_add_class(context,"mate-panel-menu-bar");
-#endif
+
return menu;
}
@@ -612,9 +611,7 @@ mate_panel_applet_position_menu (GtkMenu *menu,
{
GtkAllocation allocation;
GtkRequisition requisition;
-#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *device;
-#endif
GdkScreen *screen;
GtkWidget *parent;
int menu_x = 0;
@@ -628,21 +625,15 @@ mate_panel_applet_position_menu (GtkMenu *menu,
screen = gtk_widget_get_screen (applet);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
-#else
- gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
-#endif
gdk_window_get_origin (gtk_widget_get_window (applet), &menu_x, &menu_y);
#if GTK_CHECK_VERSION(3, 20, 0)
device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (applet)));
gdk_window_get_device_position (gtk_widget_get_window (applet), device, &pointer_x, &pointer_y, NULL);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (applet)));
gdk_window_get_device_position (gtk_widget_get_window (applet), device, &pointer_x, &pointer_y, NULL);
-#else
- gtk_widget_get_pointer (applet, &pointer_x, &pointer_y);
#endif
gtk_widget_get_allocation (applet, &allocation);
@@ -685,11 +676,7 @@ mate_panel_applet_position_menu (GtkMenu *menu,
*x = menu_x;
*y = menu_y;
-#if GTK_CHECK_VERSION (3, 0, 0)
*push_in = FALSE;
-#else
- *push_in = TRUE;
-#endif
}
static void
diff --git a/mate-panel/button-widget.c b/mate-panel/button-widget.c
index a04fac6a..d65e22fd 100644
--- a/mate-panel/button-widget.c
+++ b/mate-panel/button-widget.c
@@ -115,62 +115,17 @@ make_hc_pixbuf (GdkPixbuf *pb)
static void
button_widget_realize(GtkWidget *widget)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GtkAllocation allocation;
- GdkWindowAttr attributes;
- gint attributes_mask;
- GtkButton *button;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (BUTTON_IS_WIDGET (widget));
-
- button = GTK_BUTTON (widget);
-
- gtk_widget_set_realized (widget, TRUE);
-
- gtk_widget_get_allocation (widget, &allocation);
-
- attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = allocation.x;
- attributes.y = allocation.y;
- attributes.width = allocation.width;
- attributes.height = allocation.height;
- attributes.wclass = GDK_INPUT_ONLY;
- attributes.event_mask = (GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_KEY_PRESS_MASK |
- GDK_ENTER_NOTIFY_MASK |
- GDK_LEAVE_NOTIFY_MASK);
- attributes_mask = GDK_WA_X | GDK_WA_Y;
-
- gtk_widget_set_window (widget, gtk_widget_get_parent_window (widget));
- g_object_ref (gtk_widget_get_window (widget));
-
- button->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes,
- attributes_mask);
- gdk_window_set_user_data (button->event_window, widget);
-
- widget->style = gtk_style_attach (widget->style, gtk_widget_get_window (widget));
-#else
gtk_widget_add_events (widget, GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_KEY_PRESS_MASK);
GTK_WIDGET_CLASS (button_widget_parent_class)->realize (widget);
-#endif
BUTTON_WIDGET (widget)->priv->icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
g_signal_connect_object (BUTTON_WIDGET (widget)->priv->icon_theme,
"changed",
G_CALLBACK (button_widget_icon_theme_changed),
-#if GTK_CHECK_VERSION (3, 0, 0)
widget,
-#else
- button,
-#endif
G_CONNECT_SWAPPED);
button_widget_reload_pixbuf (BUTTON_WIDGET (widget));
@@ -179,24 +134,9 @@ button_widget_realize(GtkWidget *widget)
static void
button_widget_unrealize (GtkWidget *widget)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_handlers_disconnect_by_func (BUTTON_WIDGET (widget)->priv->icon_theme,
G_CALLBACK (button_widget_icon_theme_changed),
widget);
-#else
- GtkButton *button;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (BUTTON_IS_WIDGET (widget));
-
- button = GTK_BUTTON (widget);
-
- if (button->event_window != NULL) {
- gdk_window_set_user_data (button->event_window, NULL);
- gdk_window_destroy (button->event_window);
- button->event_window = NULL;
- }
-#endif
GTK_WIDGET_CLASS (button_widget_parent_class)->unrealize (widget);
}
@@ -243,17 +183,6 @@ button_widget_reload_pixbuf (ButtonWidget *button)
g_free (error);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- /* We need to add a child to the button to get the right allocation of the pixbuf.
- * When the button is created without a pixbuf, get_preferred_width/height are
- * called the first time when the widget is allocated and 0x0 size is cached by
- * gtksizerequest. Since the widget doesn't change its size when a pixbuf is set,
- * gtk_widget_queue_resize() always uses the cached values instead of calling
- * get_preferred_width_height() again. So the actual size, based on pixbuf size,
- * is never used. We are overriding the draw() method, so having a child doesn't
- * affect the widget rendering anyway.
- */
-#endif
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_pixbuf (button->priv->pixbuf));
}
@@ -362,58 +291,40 @@ calc_arrow (PanelOrientation orientation,
int button_height,
int *x,
int *y,
-#if GTK_CHECK_VERSION (3, 0, 0)
gdouble *angle,
gdouble *size)
-#else
- int *width,
- int *height)
-#endif
{
GtkArrowType retval = GTK_ARROW_UP;
double scale;
scale = (orientation & PANEL_HORIZONTAL_MASK ? button_height : button_width) / 48.0;
-#if GTK_CHECK_VERSION (3, 0, 0)
*size = 12 * scale;
*angle = 0;
-#else
- *width = 12 * scale;
- *height = 12 * scale;
-#endif
switch (orientation) {
case PANEL_ORIENTATION_TOP:
*x = scale * 3;
*y = scale * (48 - 13);
-#if GTK_CHECK_VERSION (3, 0, 0)
*angle = G_PI;
-#endif
retval = GTK_ARROW_DOWN;
break;
case PANEL_ORIENTATION_BOTTOM:
*x = scale * (48 - 13);
*y = scale * 1;
-#if GTK_CHECK_VERSION (3, 0, 0)
*angle = 0;
-#endif
retval = GTK_ARROW_UP;
break;
case PANEL_ORIENTATION_LEFT:
*x = scale * (48 - 13);
*y = scale * 3;
-#if GTK_CHECK_VERSION (3, 0, 0)
*angle = G_PI / 2;
-#endif
retval = GTK_ARROW_RIGHT;
break;
case PANEL_ORIENTATION_RIGHT:
*x = scale * 1;
*y = scale * 3;
-#if GTK_CHECK_VERSION (3, 0, 0)
*angle = 3 * (G_PI / 2);
-#endif
retval = GTK_ARROW_LEFT;
break;
}
@@ -422,63 +333,33 @@ calc_arrow (PanelOrientation orientation,
}
static gboolean
-#if GTK_CHECK_VERSION (3, 0, 0)
button_widget_draw (GtkWidget *widget,
cairo_t *cr)
-#else
-button_widget_expose (GtkWidget *widget,
- GdkEventExpose *event)
-#endif
{
ButtonWidget *button_widget;
int width;
int height;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkStateFlags state_flags;
-#else
- GtkButton *button;
- GdkWindow *window;
- GtkAllocation allocation;
- GtkStyle *style;
- GdkRectangle area, image_bound;
-#endif
int off;
int x, y, w, h;
GdkPixbuf *pb = NULL;
g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- g_return_val_if_fail (event != NULL, FALSE);
-
- if (!gtk_widget_get_visible (widget) || !gtk_widget_get_mapped (widget))
- return FALSE;
-#endif
button_widget = BUTTON_WIDGET (widget);
if (!button_widget->priv->pixbuf_hc && !button_widget->priv->pixbuf)
return FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
state_flags = gtk_widget_get_state_flags (widget);
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
-#else
- gtk_widget_get_allocation (widget, &allocation);
- button = GTK_BUTTON (widget);
- window = gtk_widget_get_window (widget);
-#endif
/* offset for pressed buttons */
off = (button_widget->priv->activatable &&
-#if GTK_CHECK_VERSION (3, 0, 0)
(state_flags & GTK_STATE_FLAG_PRELIGHT) && (state_flags & GTK_STATE_FLAG_ACTIVE)) ?
BUTTON_WIDGET_DISPLACEMENT * height / 48.0 : 0;
-#else
- button->in_button && button->button_down) ?
- BUTTON_WIDGET_DISPLACEMENT * allocation.height / 48.0 : 0;
-#endif
if (!button_widget->priv->activatable) {
pb = gdk_pixbuf_copy (button_widget->priv->pixbuf);
@@ -487,11 +368,7 @@ button_widget_expose (GtkWidget *widget,
0.8,
TRUE);
} else if (panel_global_config_get_highlight_when_over () &&
-#if GTK_CHECK_VERSION (3, 0, 0)
(state_flags & GTK_STATE_FLAG_PRELIGHT || gtk_widget_has_focus (widget)))
-#else
- (button->in_button || gtk_widget_has_focus (widget)))
-#endif
pb = g_object_ref (button_widget->priv->pixbuf_hc);
else
pb = g_object_ref (button_widget->priv->pixbuf);
@@ -500,40 +377,16 @@ button_widget_expose (GtkWidget *widget,
w = gdk_pixbuf_get_width (pb);
h = gdk_pixbuf_get_height (pb);
-#if GTK_CHECK_VERSION (3, 0, 0)
x = off + (width - w)/2;
y = off + (height - h)/2;
-#else
- x = allocation.x + off + (allocation.width - w)/2;
- y = allocation.y + off + (allocation.height - h)/2;
-
- image_bound.x = x;
- image_bound.y = y;
- image_bound.width = w;
- image_bound.height = h;
-
- area = event->area;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_save (cr);
gdk_cairo_set_source_pixbuf (cr, pb, x, y);
cairo_paint (cr);
cairo_restore (cr);
-#else
- if (gdk_rectangle_intersect (&area, &allocation, &area) &&
- gdk_rectangle_intersect (&image_bound, &area, &image_bound))
- gdk_draw_pixbuf (window, NULL, pb,
- image_bound.x - x, image_bound.y - y,
- image_bound.x, image_bound.y,
- image_bound.width, image_bound.height,
- GDK_RGB_DITHER_NORMAL,
- 0, 0);
-#endif
g_object_unref (pb);
-#if GTK_CHECK_VERSION (3, 0, 0)
context = gtk_widget_get_style_context (widget);
if (button_widget->priv->arrow) {
@@ -591,66 +444,10 @@ button_widget_expose (GtkWidget *widget,
gtk_style_context_restore (context);
}
-#else
- style = gtk_widget_get_style (widget);
-
- if (button_widget->priv->arrow) {
- GtkArrowType arrow_type;
-
- arrow_type = calc_arrow (button_widget->priv->orientation,
- allocation.width,
- allocation.height,
- &x,
- &y,
- &width,
- &height);
-
- gtk_paint_arrow (style,
- window,
- GTK_STATE_NORMAL,
- GTK_SHADOW_NONE,
- NULL,
- widget,
- "panel-button",
- arrow_type,
- TRUE,
- allocation.x + x,
- allocation.y + y,
- width,
- height);
- }
-
- if (button_widget->priv->dnd_highlight) {
- gdk_draw_rectangle(window, style->black_gc, FALSE,
- allocation.x, allocation.y,
- allocation.width - 1,
- allocation.height - 1);
- }
-
- if (gtk_widget_has_focus (widget)) {
- gint focus_pad;
-
- gtk_widget_style_get (widget,
- "focus-padding", &focus_pad,
- NULL);
-
- x = allocation.x + focus_pad;
- y = allocation.y + focus_pad;
- width = allocation.width - 2 * focus_pad;
- height = allocation.height - 2 * focus_pad;
-
- gtk_paint_focus (style,
- window,
- GTK_STATE_NORMAL,
- &event->area, widget, "button",
- x, y, width, height);
- }
-#endif
return FALSE;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
button_widget_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
@@ -688,19 +485,6 @@ button_widget_get_preferred_height (GtkWidget *widget,
*minimal_height = *natural_height = size;
}
-#else
-static void
-button_widget_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- ButtonWidget *button_widget = BUTTON_WIDGET (widget);
-
- if (button_widget->priv->pixbuf) {
- requisition->width = gdk_pixbuf_get_width (button_widget->priv->pixbuf);
- requisition->height = gdk_pixbuf_get_height (button_widget->priv->pixbuf);
- }
-}
-#endif
static void
button_widget_size_allocate (GtkWidget *widget,
@@ -709,9 +493,7 @@ button_widget_size_allocate (GtkWidget *widget,
ButtonWidget *button_widget = BUTTON_WIDGET (widget);
int size;
-#if GTK_CHECK_VERSION (3, 0, 0)
GTK_WIDGET_CLASS (button_widget_parent_class)->size_allocate (widget, allocation);
-#endif
if (button_widget->priv->orientation & PANEL_HORIZONTAL_MASK)
size = allocation->height;
@@ -734,19 +516,6 @@ button_widget_size_allocate (GtkWidget *widget,
button_widget_reload_pixbuf (button_widget);
}
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_widget_set_allocation (widget, allocation);
- GtkButton *button = GTK_BUTTON (widget);
-
- if (gtk_widget_get_realized (widget)) {
- gdk_window_move_resize (button->event_window,
- allocation->x,
- allocation->y,
- allocation->width,
- allocation->height);
- }
-#endif
}
static void
@@ -783,21 +552,13 @@ button_widget_enter_notify (GtkWidget *widget, GdkEventCrossing *event)
g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStateFlags state_flags = gtk_widget_get_state_flags (widget);
in_button = state_flags & GTK_STATE_FLAG_PRELIGHT;
-#else
- in_button = GTK_BUTTON (widget)->in_button;
-#endif
GTK_WIDGET_CLASS (button_widget_parent_class)->enter_notify_event (widget, event);
-#if GTK_CHECK_VERSION (3, 0, 0)
state_flags = gtk_widget_get_state_flags (widget);
if (in_button != (state_flags & GTK_STATE_FLAG_PRELIGHT) &&
-#else
- if (in_button != GTK_BUTTON (widget)->in_button &&
-#endif
panel_global_config_get_highlight_when_over ())
gtk_widget_queue_draw (widget);
@@ -811,21 +572,13 @@ button_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event)
g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStateFlags state_flags = gtk_widget_get_state_flags (widget);
in_button = state_flags & GTK_STATE_FLAG_PRELIGHT;
-#else
- in_button = GTK_BUTTON (widget)->in_button;
-#endif
GTK_WIDGET_CLASS (button_widget_parent_class)->leave_notify_event (widget, event);
-#if GTK_CHECK_VERSION (3, 0, 0)
state_flags = gtk_widget_get_state_flags (widget);
if (in_button != (state_flags & GTK_STATE_FLAG_PRELIGHT) &&
-#else
- if (in_button != GTK_BUTTON (widget)->in_button &&
-#endif
panel_global_config_get_highlight_when_over ())
gtk_widget_queue_draw (widget);
@@ -869,14 +622,9 @@ button_widget_class_init (ButtonWidgetClass *klass)
widget_class->realize = button_widget_realize;
widget_class->unrealize = button_widget_unrealize;
widget_class->size_allocate = button_widget_size_allocate;
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->get_preferred_width = button_widget_get_preferred_width;
widget_class->get_preferred_height = button_widget_get_preferred_height;
widget_class->draw = button_widget_draw;
-#else
- widget_class->size_request = button_widget_size_request;
- widget_class->expose_event = button_widget_expose;
-#endif
widget_class->button_press_event = button_widget_button_press;
widget_class->enter_notify_event = button_widget_enter_notify;
widget_class->leave_notify_event = button_widget_leave_notify;
diff --git a/mate-panel/libegg/eggsmclient-private.h b/mate-panel/libegg/eggsmclient-private.h
index c97b5f2f..f7f0e83f 100644
--- a/mate-panel/libegg/eggsmclient-private.h
+++ b/mate-panel/libegg/eggsmclient-private.h
@@ -21,9 +21,6 @@
#define __EGG_SM_CLIENT_PRIVATE_H__
#include <gtk/gtk.h>
-#if !GTK_CHECK_VERSION (3, 0, 0)
-#include <gdkconfig.h>
-#endif
#include "eggsmclient.h"
#ifdef __cplusplus
diff --git a/mate-panel/libegg/eggsmclient-xsmp.c b/mate-panel/libegg/eggsmclient-xsmp.c
index 726c13da..2b707a76 100644
--- a/mate-panel/libegg/eggsmclient-xsmp.c
+++ b/mate-panel/libegg/eggsmclient-xsmp.c
@@ -368,13 +368,7 @@ sm_client_xsmp_startup (EggSMClient *client,
xsmp->client_id = g_strdup (ret_client_id);
free (ret_client_id);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_enter ();
-#endif
gdk_x11_set_sm_client_id (xsmp->client_id);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_leave ();
-#endif
g_debug ("Got client ID \"%s\"", xsmp->client_id);
}
@@ -542,10 +536,6 @@ idle_do_pending_events (gpointer data)
EggSMClientXSMP *xsmp = data;
EggSMClient *client = data;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_enter ();
-#endif
-
xsmp->idle = 0;
if (xsmp->waiting_to_emit_quit)
@@ -569,9 +559,6 @@ idle_do_pending_events (gpointer data)
}
out:
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_leave ();
-#endif
return FALSE;
}
@@ -1293,13 +1280,7 @@ process_ice_messages (IceConn ice_conn)
{
IceProcessMessagesStatus status;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_enter ();
-#endif
status = IceProcessMessages (ice_conn, NULL, NULL);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_leave ();
-#endif
switch (status)
{
diff --git a/mate-panel/libmate-panel-applet-private/panel-applet-container.c b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
index 7aa34d6a..95fca64b 100644
--- a/mate-panel/libmate-panel-applet-private/panel-applet-container.c
+++ b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
@@ -22,9 +22,7 @@
#include <string.h>
#include <gtk/gtk.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
#include <gtk/gtkx.h>
-#endif
#include "panel-applet-container.h"
#include "panel-marshal.h"
diff --git a/mate-panel/libpanel-util/panel-color.c b/mate-panel/libpanel-util/panel-color.c
index 9ac198a8..864d68d8 100644
--- a/mate-panel/libpanel-util/panel-color.c
+++ b/mate-panel/libpanel-util/panel-color.c
@@ -1,6 +1,5 @@
#include "panel-color.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
/**
* rgb_to_hls:
* @r: on input, red; on output, hue
@@ -197,7 +196,3 @@ gtk_style_shade (GdkRGBA *a, GdkRGBA *b, gdouble k)
b->green = green;
b->blue = blue;
}
-#else
-
-#endif
-
diff --git a/mate-panel/libpanel-util/panel-color.h b/mate-panel/libpanel-util/panel-color.h
index 753c28ff..327235db 100644
--- a/mate-panel/libpanel-util/panel-color.h
+++ b/mate-panel/libpanel-util/panel-color.h
@@ -1,13 +1,11 @@
#ifndef PANEL_COLOR_H
#define PANEL_COLOR_H
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
G_BEGIN_DECLS
-#if GTK_CHECK_VERSION (3, 0, 0)
void gtk_style_shade (GdkRGBA *a, GdkRGBA *b, gdouble k);
-#endif
G_END_DECLS
diff --git a/mate-panel/libpanel-util/panel-icon-chooser.c b/mate-panel/libpanel-util/panel-icon-chooser.c
index 91cbdc59..98dcef8e 100644
--- a/mate-panel/libpanel-util/panel-icon-chooser.c
+++ b/mate-panel/libpanel-util/panel-icon-chooser.c
@@ -421,11 +421,7 @@ _panel_icon_chooser_clicked (GtkButton *button)
if (info) {
path = g_strdup (gtk_icon_info_get_filename (info));
-#if GTK_CHECK_VERSION (3, 8, 0)
g_object_unref (info);
-#else
- gtk_icon_info_free (info);
-#endif
}
}
diff --git a/mate-panel/libpanel-util/panel-launch.c b/mate-panel/libpanel-util/panel-launch.c
index 66502b6d..59ca900a 100644
--- a/mate-panel/libpanel-util/panel-launch.c
+++ b/mate-panel/libpanel-util/panel-launch.c
@@ -109,12 +109,8 @@ panel_app_info_launch_uris (GAppInfo *appinfo,
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-#if GTK_CHECK_VERSION(3, 0, 0)
GdkDisplay *display = gdk_display_get_default ();
context = gdk_display_get_app_launch_context (display);
-#else
- context = gdk_app_launch_context_new ();
-#endif
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, timestamp);
diff --git a/mate-panel/libpanel-util/panel-show.h b/mate-panel/libpanel-util/panel-show.h
index 60969c06..ec3e9baa 100644
--- a/mate-panel/libpanel-util/panel-show.h
+++ b/mate-panel/libpanel-util/panel-show.h
@@ -25,7 +25,7 @@
#ifndef PANEL_SHOW_H
#define PANEL_SHOW_H
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
#ifdef __cplusplus
extern "C" {
diff --git a/mate-panel/libpanel-util/panel-xdg.c b/mate-panel/libpanel-util/panel-xdg.c
index 501a783c..bcdbb5fa 100644
--- a/mate-panel/libpanel-util/panel-xdg.c
+++ b/mate-panel/libpanel-util/panel-xdg.c
@@ -26,6 +26,7 @@
#include <glib.h>
#include <gio/gio.h>
+#include <gtk/gtk.h>
#include "panel-xdg.h"
diff --git a/mate-panel/libpanel-util/panel-xdg.h b/mate-panel/libpanel-util/panel-xdg.h
index 91aa2185..359c91b2 100644
--- a/mate-panel/libpanel-util/panel-xdg.h
+++ b/mate-panel/libpanel-util/panel-xdg.h
@@ -25,7 +25,7 @@
#ifndef PANEL_XDG_H
#define PANEL_XDG_H
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
#ifdef __cplusplus
extern "C" {
diff --git a/mate-panel/menu.c b/mate-panel/menu.c
index 053c077b..fd2cccbd 100644
--- a/mate-panel/menu.c
+++ b/mate-panel/menu.c
@@ -31,7 +31,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <libmate-desktop/mate-gsettings.h>
-
+#include <matemenu-tree.h>
#include <libpanel-util/panel-keyfile.h>
#include <libpanel-util/panel-xdg.h>
@@ -445,16 +445,12 @@ restore_grabs(GtkWidget *w, gpointer data)
if (viewable)
xgrab_shell = parent;
-#if GTK_CHECK_VERSION (3, 0, 0)
parent = gtk_menu_shell_get_parent_shell (GTK_MENU_SHELL (parent));
-#else
- parent = GTK_MENU_SHELL (parent)->parent_menu_shell;
-#endif
}
/*only grab if this HAD a grab before*/
/* FIXME fix for GTK3 */
-#if !GTK_CHECK_VERSION (3, 0, 0)
+#if 0
if (xgrab_shell && (GTK_MENU_SHELL (xgrab_shell)->have_xgrab))
{
GdkWindow *window = gtk_widget_get_window (xgrab_shell);
@@ -667,20 +663,11 @@ drag_end_menu_cb (GtkWidget *widget, GdkDragContext *context)
if (viewable)
xgrab_shell = parent;
-#if GTK_CHECK_VERSION (3, 0, 0)
parent = gtk_menu_shell_get_parent_shell (GTK_MENU_SHELL (parent));
-#else
- parent = GTK_MENU_SHELL (parent)->parent_menu_shell;
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
if (xgrab_shell)
-#else
- if (xgrab_shell && !gtk_menu_get_tearoff_state (GTK_MENU(xgrab_shell)))
-#endif
{
-#if GTK_CHECK_VERSION (3, 0, 0)
gboolean status;
GdkDisplay *display;
GdkDevice *pointer;
@@ -690,12 +677,10 @@ drag_end_menu_cb (GtkWidget *widget, GdkDragContext *context)
#else
GdkDeviceManager *device_manager;
#endif
-#endif
GdkWindow *window = gtk_widget_get_window (xgrab_shell);
GdkCursor *cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
GDK_ARROW);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_window_get_display (window);
#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat (display);
@@ -725,37 +710,18 @@ drag_end_menu_cb (GtkWidget *widget, GdkDragContext *context)
GDK_KEY_PRESS | GDK_KEY_RELEASE,
NULL, GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS)
{
-#else
- if ((gdk_pointer_grab (window, TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
- GDK_POINTER_MOTION_MASK,
- NULL, cursor, GDK_CURRENT_TIME) == 0))
- {
- if (gdk_keyboard_grab (window, TRUE,
- GDK_CURRENT_TIME) == 0)
- {
-#endif
/* FIXME fix for GTK3 */
-#if !GTK_CHECK_VERSION (3, 0, 0)
+#if 0
GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE;
#endif
}
else
{
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
}
}
g_object_unref (cursor);
-#else
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- }
- }
-
- gdk_cursor_unref (cursor);
-#endif
}
}
@@ -1061,12 +1027,11 @@ create_fake_menu (MateMenuTreeDirectory *directory)
/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *toplevel = gtk_widget_get_toplevel (menu);
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
gtk_widget_set_visual(GTK_WIDGET(toplevel), visual);
-#endif
+
return menu;
}
GtkWidget *
@@ -1273,16 +1238,11 @@ handle_matemenu_tree_changed (MateMenuTree *tree,
{
guint idle_id;
-#if GTK_CHECK_VERSION (3, 0, 0)
GList *list, *l;
list = gtk_container_get_children (GTK_CONTAINER (menu));
for (l = list; l; l = l->next)
gtk_widget_destroy (l->data);
g_list_free (list);
-#else
- while (GTK_MENU_SHELL (menu)->children)
- gtk_widget_destroy (GTK_MENU_SHELL (menu)->children->data);
-#endif
g_object_set_data_full (G_OBJECT (menu),
"panel-menu-tree-directory",
@@ -1368,12 +1328,11 @@ create_applications_menu (const char *menu_file,
matemenu_tree_unref (tree);
/*HACK Fix any failures of compiz/other wm's to communicate with gtk for transparency */
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *toplevel = gtk_widget_get_toplevel (menu);
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
gtk_widget_set_visual(GTK_WIDGET(toplevel), visual);
-#endif
+
return menu;
}
@@ -1490,31 +1449,20 @@ panel_menu_key_press_handler (GtkWidget *widget,
GdkEventKey *event)
{
gboolean retval = FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *active_menu_item = NULL;
-#endif
if ((event->keyval == GDK_KEY_Menu) ||
(event->keyval == GDK_KEY_F10 &&
(event->state & gtk_accelerator_get_default_mod_mask ()) == GDK_SHIFT_MASK)) {
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
-#if GTK_CHECK_VERSION (3, 0, 0)
active_menu_item = gtk_menu_shell_get_selected_item (menu_shell);
if (active_menu_item && gtk_menu_item_get_submenu (GTK_MENU_ITEM (active_menu_item)) == NULL) {
-#else
- if (menu_shell->active_menu_item &&
- GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu == NULL) {
-#endif
GdkEventButton bevent;
bevent.button = 3;
bevent.time = GDK_CURRENT_TIME;
-#if GTK_CHECK_VERSION (3, 0, 0)
retval = show_item_menu (active_menu_item, &bevent);
-#else
- retval = show_item_menu (menu_shell->active_menu_item, &bevent);
-#endif
}
}
diff --git a/mate-panel/menu.h b/mate-panel/menu.h
index 0c6d3495..bd2398de 100644
--- a/mate-panel/menu.h
+++ b/mate-panel/menu.h
@@ -25,7 +25,6 @@
#include "panel-widget.h"
#include "applet.h"
-#include <matemenu-tree.h>
#include <gio/gio.h>
#ifdef __cplusplus
diff --git a/mate-panel/nothing.cP b/mate-panel/nothing.cP
index e3f2b51e..ae06ed7e 100644
--- a/mate-panel/nothing.cP
+++ b/mate-panel/nothing.cP
@@ -17,7 +17,8 @@
#include "panel-util.h"
#include "nothing.h"
-#if !GTK_CHECK_VERSION (3, 0, 0)
+/* FIXME fix for GTK+3 */
+#if 0
static void
pixbuf_reverse (GdkPixbuf *gp)
{
@@ -1394,11 +1395,7 @@ start_geginv (void)
gtk_widget_set_double_buffered (GTK_WIDGET (geginv_canvas), FALSE);
gtk_widget_set_size_request (geginv_canvas, inv_width, inv_height);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-#else
- vbox = gtk_vbox_new (FALSE, 0);
-#endif
gtk_container_add (GTK_CONTAINER (geginv), vbox);
gtk_box_pack_start (GTK_BOX (vbox), geginv_canvas, TRUE, TRUE, 0);
diff --git a/mate-panel/nothing.h b/mate-panel/nothing.h
index 2c8d8f79..f615ba7a 100644
--- a/mate-panel/nothing.h
+++ b/mate-panel/nothing.h
@@ -7,7 +7,8 @@
extern "C" {
#endif
-#if !GTK_CHECK_VERSION (3, 0, 0)
+/* FIXME fix for GTK+3 */
+#if 0
void start_screen_check (void);
void start_geginv (void);
gboolean panel_dialog_window_event (GtkWidget *window,
diff --git a/mate-panel/panel-action-button.c b/mate-panel/panel-action-button.c
index 67be0f78..27f1c7bf 100644
--- a/mate-panel/panel-action-button.c
+++ b/mate-panel/panel-action-button.c
@@ -694,11 +694,7 @@ panel_action_button_connect_to_gsettings (PanelActionButton *button)
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_action_button_style_updated (PanelActionButton *button)
-#else
-panel_action_button_style_set (PanelActionButton *button)
-#endif
{
if (actions [button->priv->type].icon_name != NULL)
button_widget_set_icon_name (BUTTON_WIDGET (button), actions [button->priv->type].icon_name);
@@ -742,13 +738,8 @@ panel_action_button_load (PanelActionButtonType type,
panel_action_button_connect_to_gsettings (button);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect (button, "style-updated",
G_CALLBACK (panel_action_button_style_updated), NULL);
-#else
- g_signal_connect (button, "style-set",
- G_CALLBACK (panel_action_button_style_set), NULL);
-#endif
}
void
diff --git a/mate-panel/panel-action-protocol.c b/mate-panel/panel-action-protocol.c
index ca5b7b5b..e57c8e35 100644
--- a/mate-panel/panel-action-protocol.c
+++ b/mate-panel/panel-action-protocol.c
@@ -101,9 +101,7 @@ panel_action_protocol_filter (GdkXEvent *gdk_xevent,
{
GdkWindow *window;
GdkScreen *screen;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
-#endif
XEvent *xevent = (XEvent *) gdk_xevent;
if (xevent->type != ClientMessage)
@@ -113,21 +111,14 @@ panel_action_protocol_filter (GdkXEvent *gdk_xevent,
(xevent->xclient.message_type != atom_gnome_panel_action))
return GDK_FILTER_CONTINUE;
-#if GTK_CHECK_VERSION (3, 0, 0)
screen = gdk_event_get_screen (event);
display = gdk_screen_get_display (screen);
window = gdk_x11_window_lookup_for_display (display, xevent->xclient.window);
-#else
- window = gdk_window_lookup (xevent->xclient.window);
- screen = gdk_drawable_get_screen (window);
-#endif
if (!window)
return GDK_FILTER_CONTINUE;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (window != gdk_screen_get_root_window (screen))
return GDK_FILTER_CONTINUE;
-#endif
if (xevent->xclient.data.l [0] == atom_mate_panel_action_main_menu)
panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1]);
diff --git a/mate-panel/panel-addto.c b/mate-panel/panel-addto.c
index bd1f47c6..7f9a3f6e 100644
--- a/mate-panel/panel-addto.c
+++ b/mate-panel/panel-addto.c
@@ -1248,18 +1248,10 @@ panel_addto_dialog_new (PanelWidget *panel_widget)
g_signal_connect (dialog->addto_dialog, "destroy",
G_CALLBACK (panel_addto_dialog_destroy), dialog);
-#if GTK_CHECK_VERSION (3, 0, 0)
inner_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- inner_vbox = gtk_vbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (dialog_vbox), inner_vbox, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
find_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- find_hbox = gtk_hbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (inner_vbox), find_hbox, FALSE, FALSE, 0);
dialog->label = gtk_label_new_with_mnemonic ("");
diff --git a/mate-panel/panel-addto.h b/mate-panel/panel-addto.h
index 5e092d0f..f1defdc5 100644
--- a/mate-panel/panel-addto.h
+++ b/mate-panel/panel-addto.h
@@ -25,6 +25,9 @@
#ifndef __PANEL_ADDTO_H__
#define __PANEL_ADDTO_H__
+#include <gtk/gtk.h>
+#include "panel-widget.h"
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/mate-panel/panel-applet-frame.c b/mate-panel/panel-applet-frame.c
index 922e449d..dea79339 100644
--- a/mate-panel/panel-applet-frame.c
+++ b/mate-panel/panel-applet-frame.c
@@ -94,7 +94,6 @@ struct _MatePanelAppletFramePrivate {
guint has_handle : 1;
};
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean
mate_panel_applet_frame_draw (GtkWidget *widget,
cairo_t *cr)
@@ -160,60 +159,6 @@ mate_panel_applet_frame_draw (GtkWidget *widget,
return FALSE;
}
-#else
-static void
-mate_panel_applet_frame_paint (GtkWidget *widget,
- GdkRectangle *area)
-{
- MatePanelAppletFrame *frame;
-
- frame = MATE_PANEL_APPLET_FRAME (widget);
-
- if (!frame->priv->has_handle)
- return;
-
- if (gtk_widget_is_drawable (widget)) {
- GtkOrientation orientation = GTK_ORIENTATION_HORIZONTAL;
-
- switch (frame->priv->orientation) {
- case PANEL_ORIENTATION_TOP:
- case PANEL_ORIENTATION_BOTTOM:
- orientation = GTK_ORIENTATION_VERTICAL;
- break;
- case PANEL_ORIENTATION_LEFT:
- case PANEL_ORIENTATION_RIGHT:
- orientation = GTK_ORIENTATION_HORIZONTAL;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- gtk_paint_handle (
- gtk_widget_get_style (widget), gtk_widget_get_window (widget),
- gtk_widget_get_state (widget),
- GTK_SHADOW_OUT,
- area, widget, "handlebox",
- frame->priv->handle_rect.x,
- frame->priv->handle_rect.y,
- frame->priv->handle_rect.width,
- frame->priv->handle_rect.height,
- orientation);
- }
-}
-
-static gboolean mate_panel_applet_frame_expose(GtkWidget* widget, GdkEventExpose* event)
-{
- if (gtk_widget_is_drawable (widget))
- {
- GTK_WIDGET_CLASS (mate_panel_applet_frame_parent_class)->expose_event (widget, event);
-
- mate_panel_applet_frame_paint (widget, &event->area);
- }
-
- return FALSE;
-}
-#endif
static void
mate_panel_applet_frame_update_background_size (MatePanelAppletFrame *frame,
@@ -239,7 +184,6 @@ mate_panel_applet_frame_update_background_size (MatePanelAppletFrame *frame,
mate_panel_applet_frame_change_background (frame, background->type);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
mate_panel_applet_frame_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width)
{
@@ -317,52 +261,6 @@ mate_panel_applet_frame_get_preferred_height(GtkWidget *widget, gint *minimal_he
break;
}
}
-#else
-static void
-mate_panel_applet_frame_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- MatePanelAppletFrame *frame;
- GtkBin *bin;
- GtkWidget *child;
- GtkRequisition child_requisition;
- guint border_width;
-
- frame = MATE_PANEL_APPLET_FRAME (widget);
- bin = GTK_BIN (widget);
-
- if (!frame->priv->has_handle) {
- GTK_WIDGET_CLASS (mate_panel_applet_frame_parent_class)->size_request (widget, requisition);
- return;
- }
-
- child = gtk_bin_get_child (bin);
- if (child && gtk_widget_get_visible (child)) {
- gtk_widget_size_request (child, &child_requisition);
-
- requisition->width = child_requisition.width;
- requisition->height = child_requisition.height;
- }
-
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- requisition->width += border_width;
- requisition->height += border_width;
-
- switch (frame->priv->orientation) {
- case PANEL_ORIENTATION_TOP:
- case PANEL_ORIENTATION_BOTTOM:
- requisition->width += HANDLE_SIZE;
- break;
- case PANEL_ORIENTATION_LEFT:
- case PANEL_ORIENTATION_RIGHT:
- requisition->height += HANDLE_SIZE;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-}
-#endif
static void
mate_panel_applet_frame_size_allocate (GtkWidget *widget,
@@ -486,7 +384,6 @@ mate_panel_applet_frame_button_changed (GtkWidget *widget,
{
MatePanelAppletFrame *frame;
gboolean handled = FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
#if GTK_CHECK_VERSION (3, 20, 0)
GdkSeat *seat;
@@ -494,7 +391,6 @@ mate_panel_applet_frame_button_changed (GtkWidget *widget,
GdkDevice *pointer;
GdkDeviceManager *device_manager;
#endif
-#endif
frame = MATE_PANEL_APPLET_FRAME (widget);
@@ -527,13 +423,11 @@ mate_panel_applet_frame_button_changed (GtkWidget *widget,
display = gtk_widget_get_display (widget);
seat = gdk_display_get_default_seat (display);
gdk_seat_ungrab (seat);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
display = gtk_widget_get_display (widget);
device_manager = gdk_display_get_device_manager (display);
pointer = gdk_device_manager_get_client_pointer (device_manager);
gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
-#else
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
#endif
MATE_PANEL_APPLET_FRAME_GET_CLASS (frame)->popup_menu (frame,
@@ -575,14 +469,9 @@ mate_panel_applet_frame_class_init (MatePanelAppletFrameClass *klass)
gobject_class->finalize = mate_panel_applet_frame_finalize;
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->draw = mate_panel_applet_frame_draw;
widget_class->get_preferred_width = mate_panel_applet_frame_get_preferred_width;
widget_class->get_preferred_height = mate_panel_applet_frame_get_preferred_height;
-#else
- widget_class->expose_event = mate_panel_applet_frame_expose;
- widget_class->size_request = mate_panel_applet_frame_size_request;
-#endif
widget_class->size_allocate = mate_panel_applet_frame_size_allocate;
widget_class->button_press_event = mate_panel_applet_frame_button_changed;
widget_class->button_release_event = mate_panel_applet_frame_button_changed;
@@ -666,12 +555,7 @@ mate_panel_applet_frame_change_background (MatePanelAppletFrame *frame,
#else
background = &PANEL_WIDGET (parent)->background;
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_background_apply_css (background, GTK_WIDGET (frame));
-#else
- panel_background_change_background_on_widget (background,
- GTK_WIDGET (frame));
-#endif
}
MATE_PANEL_APPLET_FRAME_GET_CLASS (frame)->change_background (frame, type);
diff --git a/mate-panel/panel-background-monitor.c b/mate-panel/panel-background-monitor.c
index a660ca1e..c2cd431d 100644
--- a/mate-panel/panel-background-monitor.c
+++ b/mate-panel/panel-background-monitor.c
@@ -65,11 +65,7 @@ struct _PanelBackgroundMonitor {
Atom xatom;
GdkAtom gdkatom;
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_surface_t *surface;
-#else
- GdkPixmap *gdkpixmap;
-#endif
GdkPixbuf *gdkpixbuf;
int width;
@@ -80,20 +76,14 @@ struct _PanelBackgroundMonitor {
G_DEFINE_TYPE (PanelBackgroundMonitor, panel_background_monitor, G_TYPE_OBJECT)
-#if GTK_CHECK_VERSION (3, 0, 0)
static PanelBackgroundMonitor *global_background_monitor = NULL;
-#else
-static PanelBackgroundMonitor **global_background_monitors = NULL;
-#endif
static guint signals [LAST_SIGNAL] = { 0 };
-#if GTK_CHECK_VERSION(3, 0, 0)
gboolean gdk_window_check_composited_wm(GdkWindow* window)
{
return gdk_screen_is_composited(gdk_window_get_screen(window));
}
-#endif
static void
panel_background_monitor_finalize (GObject *object)
@@ -107,15 +97,9 @@ panel_background_monitor_finalize (GObject *object)
g_signal_handlers_disconnect_by_func (monitor->screen,
panel_background_monitor_changed, monitor);
-#if GTK_CHECK_VERSION (3, 0, 0)
if (monitor->surface)
cairo_surface_destroy (monitor->surface);
monitor->surface= NULL;
-#else
- if (monitor->gdkpixmap)
- g_object_unref (monitor->gdkpixmap);
- monitor->gdkpixmap = NULL;
-#endif
if (monitor->gdkpixbuf)
g_object_unref (monitor->gdkpixbuf);
@@ -152,11 +136,7 @@ panel_background_monitor_init (PanelBackgroundMonitor *monitor)
monitor->gdkatom = gdk_atom_intern_static_string ("_XROOTPMAP_ID");
monitor->xatom = gdk_x11_atom_to_xatom (monitor->gdkatom);
-#if GTK_CHECK_VERSION (3, 0, 0)
monitor->surface = NULL;
-#else
- monitor->gdkpixmap = NULL;
-#endif
monitor->gdkpixbuf = NULL;
monitor->display_grabbed = FALSE;
@@ -202,7 +182,6 @@ panel_background_monitor_new (GdkScreen *screen)
PanelBackgroundMonitor *
panel_background_monitor_get_for_screen (GdkScreen *screen)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
if (!global_background_monitor) {
global_background_monitor = panel_background_monitor_new (screen);
@@ -213,46 +192,14 @@ panel_background_monitor_get_for_screen (GdkScreen *screen)
}
return g_object_ref (global_background_monitor);
-#else
- int screen_number;
-
- screen_number = gdk_screen_get_number (screen);
-
- if (!global_background_monitors) {
- int n_screens;
-
- n_screens = gdk_display_get_n_screens (gdk_display_get_default ());
-
- global_background_monitors = g_new0 (PanelBackgroundMonitor *, n_screens);
- }
-
- if (!global_background_monitors [screen_number]) {
- global_background_monitors [screen_number] =
- panel_background_monitor_new (screen);
-
- g_object_add_weak_pointer (
- G_OBJECT (global_background_monitors [screen_number]),
- (void **) &global_background_monitors [screen_number]);
-
- return global_background_monitors [screen_number];
- }
-
- return g_object_ref (global_background_monitors [screen_number]);
-#endif
}
static void
panel_background_monitor_changed (PanelBackgroundMonitor *monitor)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
if (monitor->surface)
cairo_surface_destroy (monitor->surface);
monitor->surface = NULL;
-#else
- if (monitor->gdkpixmap)
- g_object_unref (monitor->gdkpixmap);
- monitor->gdkpixmap = NULL;
-#endif
if (monitor->gdkpixbuf)
g_object_unref (monitor->gdkpixbuf);
@@ -282,39 +229,6 @@ panel_background_monitor_xevent_filter (GdkXEvent *xevent,
return GDK_FILTER_CONTINUE;
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-panel_background_monitor_setup_pixmap (PanelBackgroundMonitor *monitor)
-{
- Pixmap *prop_data = NULL;
- GdkAtom prop_type;
-
- g_assert (monitor->display_grabbed);
-
- if (!gdk_property_get (
- monitor->gdkwindow, monitor->gdkatom,
- gdk_x11_xatom_to_atom (XA_PIXMAP), 0, 10,
- FALSE, &prop_type, NULL, NULL, (gpointer) &prop_data))
- return;
-
- if ((prop_type == GDK_TARGET_PIXMAP) && prop_data && prop_data [0]) {
- GdkDisplay *display;
-
- g_assert (monitor->gdkpixmap == NULL);
-
- display = gdk_screen_get_display (monitor->screen);
-
- monitor->gdkpixmap = gdk_pixmap_foreign_new_for_display (display,
- prop_data [0]);
-
- if (!monitor->gdkpixmap)
- g_warning ("couldn't get background pixmap\n");
- }
-
- g_free (prop_data);
-}
-#endif
-
static GdkPixbuf *
panel_background_monitor_tile_background (PanelBackgroundMonitor *monitor,
int width,
@@ -383,9 +297,6 @@ panel_background_monitor_tile_background (PanelBackgroundMonitor *monitor,
static void
panel_background_monitor_setup_pixbuf (PanelBackgroundMonitor *monitor)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkColormap *colormap = NULL;
-#endif
GdkDisplay *display;
int rwidth, rheight;
int pwidth, pheight;
@@ -395,19 +306,10 @@ panel_background_monitor_setup_pixbuf (PanelBackgroundMonitor *monitor)
gdk_x11_display_grab (display);
monitor->display_grabbed = TRUE;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (!monitor->surface)
monitor->surface = mate_bg_get_surface_from_root (monitor->screen);
-#else
- if (!monitor->gdkpixmap)
- panel_background_monitor_setup_pixmap (monitor);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
if (!monitor->surface)
-#else
- if (!monitor->gdkpixmap)
-#endif
{
g_warning ("couldn't get background pixmap\n");
gdk_x11_display_ungrab (display);
@@ -415,38 +317,19 @@ panel_background_monitor_setup_pixbuf (PanelBackgroundMonitor *monitor)
return;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
pwidth = cairo_xlib_surface_get_width (monitor->surface);
pheight = cairo_xlib_surface_get_height (monitor->surface);
-#else
- gdk_drawable_get_size(GDK_DRAWABLE(monitor->gdkpixmap), &pwidth, &pheight);
-#endif
gdk_window_get_geometry (monitor->gdkwindow,
-#if GTK_CHECK_VERSION (3, 0, 0)
NULL, NULL, &rwidth, &rheight);
-#else
- NULL, NULL, &rwidth, &rheight, NULL);
-#endif
monitor->width = MIN (pwidth, rwidth);
monitor->height = MIN (pheight, rheight);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- colormap = gdk_drawable_get_colormap (monitor->gdkwindow);
-#endif
-
g_assert (monitor->gdkpixbuf == NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
monitor->gdkpixbuf = gdk_pixbuf_get_from_surface (monitor->surface,
0, 0,
monitor->width, monitor->height);
-#else
- monitor->gdkpixbuf = gdk_pixbuf_get_from_drawable (
- NULL, monitor->gdkpixmap, colormap,
- 0, 0, 0, 0,
- monitor->width, monitor->height);
-#endif
gdk_x11_display_ungrab (display);
monitor->display_grabbed = FALSE;
diff --git a/mate-panel/panel-background-monitor.h b/mate-panel/panel-background-monitor.h
index 379e3313..29cafd66 100644
--- a/mate-panel/panel-background-monitor.h
+++ b/mate-panel/panel-background-monitor.h
@@ -29,7 +29,7 @@
#include <glib.h>
#include <glib-object.h>
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
#define PANEL_TYPE_BACKGROUND_MONITOR (panel_background_monitor_get_type ())
#define PANEL_BACKGROUND_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
@@ -49,9 +49,8 @@
typedef struct _PanelBackgroundMonitorClass PanelBackgroundMonitorClass;
typedef struct _PanelBackgroundMonitor PanelBackgroundMonitor;
-#if GTK_CHECK_VERSION(3, 0, 0)
gboolean gdk_window_check_composited_wm (GdkWindow* window);
-#endif
+
GType panel_background_monitor_get_type (void);
PanelBackgroundMonitor *panel_background_monitor_get_for_screen (GdkScreen *screen);
GdkPixbuf *panel_background_monitor_get_region (PanelBackgroundMonitor *monitor,
diff --git a/mate-panel/panel-background.c b/mate-panel/panel-background.c
index 3af6e13d..11812faa 100644
--- a/mate-panel/panel-background.c
+++ b/mate-panel/panel-background.c
@@ -31,9 +31,7 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <cairo.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
#include <cairo-xlib.h>
-#endif
#include "panel-background-monitor.h"
#include "panel-util.h"
@@ -44,58 +42,13 @@ static void load_background_file (PanelBackground *background);
static void
-free_prepared_resources (PanelBackground *background)
-{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- switch (background->type) {
- case PANEL_BACK_NONE:
- break;
- case PANEL_BACK_COLOR:
- if (background->has_alpha) {
- if (background->pixmap)
- g_object_unref (background->pixmap);
- background->pixmap = NULL;
- } else {
- if (background->colormap && background->color.gdk.pixel)
- gdk_colormap_free_colors (
- background->colormap,
- &background->color.gdk, 1);
- background->color.gdk.pixel = 0;
- }
- break;
- case PANEL_BACK_IMAGE:
- if (background->pixmap)
- g_object_unref (background->pixmap);
- background->pixmap = NULL;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-#endif
-}
-
-static void
set_pixbuf_background (PanelBackground *background)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
g_assert (background->composited_pattern != NULL);
gdk_window_set_background_pattern (background->window, background->composited_pattern);
-#else
- g_assert (background->composited_image != NULL);
-
- gdk_pixbuf_render_pixmap_and_mask_for_colormap (
- background->composited_image,
- background->colormap,
- &background->pixmap, NULL, 128);
-
- gdk_window_set_back_pixmap (
- background->window, background->pixmap, FALSE);
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
void panel_background_apply_css (PanelBackground *background, GtkWidget *widget)
{
GtkStyleContext *context;
@@ -135,7 +88,6 @@ panel_background_prepare_css ()
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
}
-#endif
static gboolean
panel_background_prepare (PanelBackground *background)
@@ -143,19 +95,12 @@ panel_background_prepare (PanelBackground *background)
PanelBackgroundType effective_type;
GtkWidget *widget = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (!background->transformed)
-#else
- if (!background->colormap || !background->transformed)
-#endif
return FALSE;
- free_prepared_resources (background);
-
effective_type = panel_background_effective_type (background);
switch (effective_type) {
-#if GTK_CHECK_VERSION (3, 0, 0)
case PANEL_BACK_NONE:
if (background->default_pattern) {
/* the theme background-image pattern must be scaled by
@@ -187,36 +132,6 @@ panel_background_prepare (PanelBackground *background)
&background->color);
}
break;
-#else
- case PANEL_BACK_NONE:
- if (background->default_pixmap) {
- if (background->default_pixmap != (GdkPixmap*) GDK_PARENT_RELATIVE)
- gdk_window_set_back_pixmap (background->window,
- background->default_pixmap,
- FALSE);
- else
- gdk_window_set_back_pixmap (background->window,
- NULL,
- TRUE);
- } else
- gdk_window_set_background (
- background->window, &background->default_color);
- break;
-
- case PANEL_BACK_COLOR:
- if (background->has_alpha &&
- background->composited_image)
- set_pixbuf_background (background);
- else {
- gdk_colormap_alloc_color (
- background->colormap,
- &background->color.gdk,
- FALSE, TRUE);
- gdk_window_set_background (
- background->window, &background->color.gdk);
- }
- break;
-#endif
case PANEL_BACK_IMAGE:
set_pixbuf_background (background);
@@ -231,19 +146,13 @@ panel_background_prepare (PanelBackground *background)
* decide how to draw themselves. Therefore, we need to
* make sure that all drawing has been completed before
* the applet looks at the pixmap. */
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_display_sync (gdk_window_get_display (background->window));
-#else
- gdk_display_sync (gdk_drawable_get_display (background->window));
-#endif
gdk_window_get_user_data (GDK_WINDOW (background->window),
(gpointer) &widget);
if (GTK_IS_WIDGET (widget)) {
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_background_apply_css (background, gtk_widget_get_toplevel(widget));
-#endif
gtk_widget_set_app_paintable(widget,TRUE);
gtk_widget_queue_draw (widget);
}
@@ -256,27 +165,17 @@ panel_background_prepare (PanelBackground *background)
static void
free_composited_resources (PanelBackground *background)
{
- free_prepared_resources (background);
-
background->composited = FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (background->composited_pattern)
cairo_pattern_destroy (background->composited_pattern);
background->composited_pattern = NULL;
-#else
- if (background->composited_image)
- g_object_unref (background->composited_image);
- background->composited_image = NULL;
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void _panel_background_transparency(GdkScreen* screen,PanelBackground* background)
{
panel_background_composite(background);
}
-#endif
static void
background_changed (PanelBackgroundMonitor *monitor,
@@ -307,22 +206,17 @@ get_desktop_pixbuf (PanelBackground *background)
if (!background->monitor) {
background->monitor =
panel_background_monitor_get_for_screen (
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_window_get_screen (background->window));
-#else
- gdk_drawable_get_screen (background->window));
-#endif
background->monitor_signal =
g_signal_connect (
background->monitor, "changed",
G_CALLBACK (background_changed), background);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect(gdk_window_get_screen(background->window), "composited-changed",
G_CALLBACK(_panel_background_transparency),
background);
-#endif
+
desktop = panel_background_monitor_get_region (
background->monitor,
background->region.x,
@@ -333,17 +227,9 @@ get_desktop_pixbuf (PanelBackground *background)
return desktop;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static cairo_pattern_t *
-#else
-static GdkPixbuf *
-#endif
composite_image_onto_desktop (PanelBackground *background)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkPixbuf *retval;
- unsigned char *data;
-#endif
int width, height;
cairo_t *cr;
cairo_surface_t *surface;
@@ -358,7 +244,6 @@ composite_image_onto_desktop (PanelBackground *background)
width = gdk_pixbuf_get_width (background->desktop);
height = gdk_pixbuf_get_height (background->desktop);
-#if GTK_CHECK_VERSION (3, 0, 0)
surface = gdk_window_create_similar_surface (background->window,
CAIRO_CONTENT_COLOR_ALPHA,
width, height);
@@ -366,30 +251,16 @@ composite_image_onto_desktop (PanelBackground *background)
cairo_surface_destroy (surface);
return NULL;
}
-#else
- data = g_malloc (width * height * 4);
- if (!data)
- return NULL;
-
- surface = cairo_image_surface_create_for_data (data,
- CAIRO_FORMAT_RGB24,
- width, height,
- width * 4);
-#endif
cr = cairo_create (surface);
-#if GTK_CHECK_VERSION (3, 0, 0)
if(!gdk_window_check_composited_wm(background->window)){
-#endif
- cairo_set_source_rgb (cr, 1, 1, 1);
- cairo_paint (cr);
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_paint (cr);
- gdk_cairo_set_source_pixbuf (cr, background->desktop, 0, 0);
- cairo_rectangle (cr, 0, 0, width, height);
- cairo_fill (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_cairo_set_source_pixbuf (cr, background->desktop, 0, 0);
+ cairo_rectangle (cr, 0, 0, width, height);
+ cairo_fill (cr);
}
-#endif
gdk_cairo_set_source_pixbuf (cr, background->transformed_image, 0, 0);
pattern = cairo_get_source (cr);
@@ -400,19 +271,11 @@ composite_image_onto_desktop (PanelBackground *background)
cairo_destroy (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
pattern = cairo_pattern_create_for_surface (surface);
cairo_surface_destroy (surface);
return pattern;
-#else
- cairo_surface_destroy (surface);
- retval = panel_util_cairo_rgbdata_to_pixbuf (data, width, height);
- g_free (data);
- return retval;
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static cairo_pattern_t *
composite_color_onto_desktop (PanelBackground *background)
{
@@ -452,45 +315,11 @@ composite_color_onto_desktop (PanelBackground *background)
return pattern;
}
-#else
-static GdkPixbuf *
-composite_color_onto_desktop (PanelBackground *background)
-{
- guint32 color;
-
- if (!background->desktop)
- background->desktop = get_desktop_pixbuf (background);
- if (!background->desktop)
- return NULL;
-
- color = ((background->color.gdk.red & 0xff00) << 8) +
- (background->color.gdk.green & 0xff00) +
- (background->color.gdk.blue >> 8);
-
- return gdk_pixbuf_composite_color_simple (
- background->desktop,
- gdk_pixbuf_get_width (background->desktop),
- gdk_pixbuf_get_height (background->desktop),
- GDK_INTERP_NEAREST,
- (255 - (background->color.alpha >> 8)),
- 255, color, color);
-}
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
static cairo_pattern_t *
get_composited_pattern (PanelBackground *background)
-#else
-static GdkPixbuf *
-get_composited_pixbuf (PanelBackground *background)
-#endif
{
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_pattern_t *retval = NULL;
-#else
- GdkPixbuf *retval = NULL;
-#endif
switch (background->type) {
case PANEL_BACK_NONE:
@@ -500,10 +329,6 @@ get_composited_pixbuf (PanelBackground *background)
break;
case PANEL_BACK_IMAGE:
retval = composite_image_onto_desktop (background);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- if (!retval)
- retval = g_object_ref (background->transformed_image);
-#endif
break;
default:
g_assert_not_reached ();
@@ -526,27 +351,13 @@ panel_background_composite (PanelBackground *background)
break;
case PANEL_BACK_COLOR:
if (background->has_alpha)
-#if GTK_CHECK_VERSION (3, 0, 0)
background->composited_pattern =
get_composited_pattern (background);
-#else
- background->composited_image =
- get_composited_pixbuf (background);
-#endif
break;
case PANEL_BACK_IMAGE:
if (background->transformed_image) {
-#if GTK_CHECK_VERSION (3, 0, 0)
background->composited_pattern =
get_composited_pattern (background);
-#else
- if (background->has_alpha)
- background->composited_image =
- get_composited_pixbuf (background);
- else
- background->composited_image =
- g_object_ref (background->transformed_image);
-#endif
}
break;
default:
@@ -741,11 +552,7 @@ panel_background_update_has_alpha (PanelBackground *background)
gboolean has_alpha = FALSE;
if (background->type == PANEL_BACK_COLOR)
-#if GTK_CHECK_VERSION (3, 0, 0)
has_alpha = (background->color.alpha < 1.);
-#else
- has_alpha = (background->color.alpha != 0xffff);
-#endif
else if (background->type == PANEL_BACK_IMAGE &&
background->loaded_image)
@@ -795,45 +602,11 @@ panel_background_set_type (PanelBackground *background,
panel_background_transform (background);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-panel_background_set_gdk_color_no_update (PanelBackground *background,
- GdkColor *gdk_color)
-{
- g_return_if_fail (gdk_color != NULL);
-
- background->color.gdk.red = gdk_color->red;
- background->color.gdk.green = gdk_color->green;
- background->color.gdk.blue = gdk_color->blue;
-}
-
-void
-panel_background_set_gdk_color (PanelBackground *background,
- GdkColor *gdk_color)
-{
- g_return_if_fail (gdk_color != NULL);
- g_return_if_fail (background != NULL);
-
- if (background->color.gdk.red == gdk_color->red &&
- background->color.gdk.green == gdk_color->green &&
- background->color.gdk.blue == gdk_color->blue)
- return;
-
- free_transformed_resources (background);
- panel_background_set_gdk_color_no_update (background, gdk_color);
- panel_background_transform (background);
-}
-#endif
-
static void
panel_background_set_opacity_no_update (PanelBackground *background,
guint16 opacity)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
background->color.alpha = opacity / 65535.0;
-#else
- background->color.alpha = opacity;
-#endif
panel_background_update_has_alpha (background);
}
@@ -841,11 +614,7 @@ void
panel_background_set_opacity (PanelBackground *background,
guint16 opacity)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
if (background->color.alpha == (opacity / 65535.0))
-#else
- if (background->color.alpha == opacity)
-#endif
return;
free_transformed_resources (background);
@@ -855,42 +624,24 @@ panel_background_set_opacity (PanelBackground *background,
static void
panel_background_set_color_no_update (PanelBackground *background,
-#if GTK_CHECK_VERSION (3, 0, 0)
const GdkRGBA *color)
-#else
- PanelColor *color)
-#endif
{
g_return_if_fail (color != NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
if (gdk_rgba_equal (color, &background->color))
return;
background->color = *color;
panel_background_update_has_alpha (background);
-#else
- panel_background_set_gdk_color_no_update (background, &(color->gdk));
- panel_background_set_opacity_no_update (background, color->alpha);
-#endif
}
void
panel_background_set_color (PanelBackground *background,
-#if GTK_CHECK_VERSION (3, 0, 0)
const GdkRGBA *color)
-#else
- PanelColor *color)
-#endif
{
g_return_if_fail (color != NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
if (gdk_rgba_equal (color, &background->color))
-#else
- if (gdk_color_equal (&color->gdk, &background->color.gdk) &&
- color->alpha == background->color.alpha)
-#endif
return;
free_transformed_resources (background);
@@ -997,11 +748,7 @@ panel_background_set_rotate (PanelBackground *background,
void
panel_background_set (PanelBackground *background,
PanelBackgroundType type,
-#if GTK_CHECK_VERSION (3, 0, 0)
const GdkRGBA *color,
-#else
- PanelColor *color,
-#endif
const char *image,
gboolean fit_image,
gboolean stretch_image,
@@ -1017,19 +764,13 @@ panel_background_set (PanelBackground *background,
void
panel_background_set_default_style (PanelBackground *background,
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA *color,
cairo_pattern_t *pattern)
-#else
- GdkColor *color,
- GdkPixmap *pixmap)
-#endif
{
g_return_if_fail (color != NULL);
background->default_color = *color;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (pattern)
cairo_pattern_reference (pattern);
@@ -1037,16 +778,6 @@ panel_background_set_default_style (PanelBackground *background,
cairo_pattern_destroy (background->default_pattern);
background->default_pattern = pattern;
-#else
- if (pixmap && pixmap != (GdkPixmap*) GDK_PARENT_RELATIVE)
- g_object_ref (pixmap);
-
- if (background->default_pixmap
- && background->default_pixmap != (GdkPixmap*) GDK_PARENT_RELATIVE)
- g_object_unref (background->default_pixmap);
-
- background->default_pixmap = pixmap;
-#endif
if (background->type == PANEL_BACK_NONE)
panel_background_prepare (background);
}
@@ -1058,27 +789,12 @@ panel_background_realized (PanelBackground *background,
{
g_return_if_fail (window != NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
if (background->window)
return;
background->window = g_object_ref (window);
panel_background_prepare_css ();
-#else
- if (background->window && background->colormap && background->gc)
- return;
-
- if (!background->window)
- background->window = g_object_ref (window);
-
- if (!background->colormap)
- background->colormap =
- g_object_ref (gdk_drawable_get_colormap (window));
-
- if (!background->gc)
- background->gc = gdk_gc_new (window);
-#endif
panel_background_prepare (background);
}
@@ -1086,21 +802,9 @@ panel_background_realized (PanelBackground *background,
void
panel_background_unrealized (PanelBackground *background)
{
- free_prepared_resources (background);
-
if (background->window)
g_object_unref (background->window);
background->window = NULL;
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- if (background->colormap)
- g_object_unref (background->colormap);
- background->colormap = NULL;
-
- if (background->gc)
- g_object_unref (background->gc);
- background->gc = NULL;
-#endif
}
void
@@ -1180,18 +884,10 @@ panel_background_init (PanelBackground *background,
background->notify_changed = notify_changed;
background->user_data = user_data;
-#if GTK_CHECK_VERSION (3, 0, 0)
background->color.red = 0.;
background->color.blue = 0.;
background->color.green = 0.;
background->color.alpha = 1.;
-#else
- background->color.gdk.red = 0;
- background->color.gdk.blue = 0;
- background->color.gdk.green = 0;
- background->color.gdk.pixel = 0;
- background->color.alpha = 0xffff;
-#endif
background->image = NULL;
background->loaded_image = NULL;
@@ -1202,40 +898,20 @@ panel_background_init (PanelBackground *background,
background->region.width = -1;
background->region.height = -1;
background->transformed_image = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
background->composited_pattern = NULL;
-#else
- background->composited_image = NULL;
-#endif
background->monitor = NULL;
background->desktop = NULL;
background->monitor_signal = -1;
background->window = NULL;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- background->pixmap = NULL;
- background->colormap = NULL;
- background->gc = NULL;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
background->default_pattern = NULL;
-#else
- background->default_pixmap = NULL;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
background->default_color.red = 0.;
background->default_color.green = 0.;
background->default_color.blue = 0.;
background->default_color.alpha = 1.;
-#else
- background->default_color.red = 0;
- background->default_color.green = 0;
- background->default_color.blue = 0;
- background->default_color.pixel = 0;
-#endif
background->fit_image = FALSE;
background->stretch_image = FALSE;
@@ -1270,24 +946,9 @@ panel_background_free (PanelBackground *background)
g_object_unref (background->window);
background->window = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (background->default_pattern)
cairo_pattern_destroy (background->default_pattern);
background->default_pattern = NULL;
-#else
- if (background->colormap)
- g_object_unref (background->colormap);
- background->colormap = NULL;
-
- if (background->gc)
- g_object_unref (background->gc);
- background->gc = NULL;
-
- if (background->default_pixmap
- && background->default_pixmap != (GdkPixmap*) GDK_PARENT_RELATIVE)
- g_object_unref (background->default_pixmap);
- background->default_pixmap = NULL;
-#endif
}
char *
@@ -1302,7 +963,6 @@ panel_background_make_string (PanelBackground *background,
effective_type = panel_background_effective_type (background);
-#if GTK_CHECK_VERSION (3, 0, 0)
if (effective_type == PANEL_BACK_IMAGE ||
(effective_type == PANEL_BACK_COLOR && background->has_alpha
&& (!gdk_window_check_composited_wm(background->window)))) {
@@ -1326,26 +986,6 @@ panel_background_make_string (PanelBackground *background,
g_free (rgba);
} else
retval = g_strdup ("none:");
-#else
- if (effective_type == PANEL_BACK_IMAGE ||
- (effective_type == PANEL_BACK_COLOR && background->has_alpha)) {
- GdkNativeWindow pixmap_xid;
-
- if (!background->pixmap)
- return NULL;
-
- pixmap_xid = GDK_WINDOW_XID (GDK_DRAWABLE (background->pixmap));
-
- retval = g_strdup_printf ("pixmap:%d,%d,%d", pixmap_xid, x, y);
- } else if (effective_type == PANEL_BACK_COLOR) {
- retval = g_strdup_printf (
- "color:%.4x%.4x%.4x",
- background->color.gdk.red,
- background->color.gdk.green,
- background->color.gdk.blue);
- } else
- retval = g_strdup ("none:");
-#endif
return retval;
}
@@ -1356,25 +996,12 @@ panel_background_get_type (PanelBackground *background)
return background->type;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
const GdkRGBA *
-#else
-const PanelColor *
-#endif
panel_background_get_color (PanelBackground *background)
{
return &(background->color);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
-const GdkPixmap *
-panel_background_get_pixmap (PanelBackground *background)
-{
- return background->pixmap;
-}
-#endif
-
-
/* What are we actually rendering - e.g. if we're supposed to
* be rendering an image, but haven't got a valid image, then
* we're rendering the default gtk background.
@@ -1385,113 +1012,8 @@ panel_background_effective_type (PanelBackground *background)
PanelBackgroundType retval;
retval = background->type;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (background->type == PANEL_BACK_IMAGE && !background->composited_pattern)
-#else
- if (background->type == PANEL_BACK_IMAGE && !background->composited_image)
-#endif
retval = PANEL_BACK_NONE;
return retval;
}
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-panel_background_set_no_background_on_widget (PanelBackground *background,
- GtkWidget *widget)
-{
- GtkRcStyle *rc_style;
-
- gtk_widget_set_style (widget, NULL);
- rc_style = gtk_rc_style_new ();
- gtk_widget_modify_style (widget, rc_style);
- g_object_unref (rc_style);
-}
-
-static void
-panel_background_set_image_background_on_widget (PanelBackground *background,
- GtkWidget *widget)
-{
- GtkAllocation allocation;
- cairo_t *cr;
- cairo_pattern_t *pattern;
- const GdkPixmap *bg_pixmap;
- GdkPixmap *pixmap;
- GtkStyle *style;
-
- bg_pixmap = panel_background_get_pixmap (background);
- if (!bg_pixmap)
- return;
-
- gtk_widget_get_allocation (widget, &allocation);
- pixmap = gdk_pixmap_new (gtk_widget_get_window (widget),
- allocation.width,
- allocation.height,
- -1);
-
- cr = gdk_cairo_create (GDK_DRAWABLE (pixmap));
- gdk_cairo_set_source_pixmap (cr, (GdkPixmap *) bg_pixmap,
- -allocation.x,
- -allocation.y);
- pattern = cairo_get_source (cr);
- cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
-
- cairo_rectangle (cr, 0, 0,
- allocation.width, allocation.height);
- cairo_fill (cr);
-
- cairo_destroy (cr);
-
- style = gtk_style_copy (gtk_widget_get_style (widget));
- if (style->bg_pixmap[GTK_STATE_NORMAL])
- g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
- style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap);
- gtk_widget_set_style (widget, style);
- g_object_unref (style);
-
- g_object_unref (pixmap);
-}
-
-static void
-panel_background_set_color_background_on_widget (PanelBackground *background,
- GtkWidget *widget)
-{
- const PanelColor *color;
-
- color = panel_background_get_color (background);
- if (color->alpha != 0xffff) {
- panel_background_set_image_background_on_widget (background,
- widget);
- return;
- }
-
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &color->gdk);
-}
-
-void
-panel_background_change_background_on_widget (PanelBackground *background,
- GtkWidget *widget)
-{
- PanelBackgroundType type;
-
- panel_background_set_no_background_on_widget (background, widget);
-
- type = panel_background_get_type (background);
-
- switch (type) {
- case PANEL_BACK_NONE:
- break;
- case PANEL_BACK_COLOR:
- panel_background_set_color_background_on_widget (background,
- widget);
- break;
- case PANEL_BACK_IMAGE:
- panel_background_set_image_background_on_widget (background,
- widget);
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-}
-#endif
diff --git a/mate-panel/panel-background.h b/mate-panel/panel-background.h
index 2ca1c451..aa0183ed 100644
--- a/mate-panel/panel-background.h
+++ b/mate-panel/panel-background.h
@@ -44,38 +44,23 @@ struct _PanelBackground {
PanelBackgroundChangedNotify notify_changed;
gpointer user_data;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- PanelColor color;
-#endif
+
char *image;
GdkPixbuf *loaded_image;
GtkOrientation orientation;
GdkRectangle region;
GdkPixbuf *transformed_image;
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_pattern_t *composited_pattern;
-#else
- GdkPixbuf *composited_image;
-#endif
PanelBackgroundMonitor *monitor;
GdkPixbuf *desktop;
gulong monitor_signal;
GdkWindow *window;
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_pattern_t *default_pattern;
GdkRGBA default_color;
-#else
- GdkPixmap *pixmap;
- GdkColormap *colormap;
- GdkGC *gc;
- GdkPixmap *default_pixmap;
- GdkColor default_color;
-#endif
guint fit_image : 1;
guint stretch_image : 1;
@@ -94,29 +79,17 @@ void panel_background_init (PanelBackground *background,
void panel_background_free (PanelBackground *background);
void panel_background_set (PanelBackground *background,
PanelBackgroundType type,
-#if GTK_CHECK_VERSION (3, 0, 0)
const GdkRGBA *color,
-#else
- PanelColor *color,
-#endif
const char *image,
gboolean fit_image,
gboolean stretch_image,
gboolean rotate_image);
void panel_background_set_type (PanelBackground *background,
PanelBackgroundType type);
-#if !GTK_CHECK_VERSION (3, 0, 0)
-void panel_background_set_gdk_color (PanelBackground *background,
- GdkColor *gdk_color);
-#endif
void panel_background_set_opacity (PanelBackground *background,
guint16 opacity);
void panel_background_set_color (PanelBackground *background,
-#if GTK_CHECK_VERSION (3, 0, 0)
const GdkRGBA *color);
-#else
- PanelColor *color);
-#endif
void panel_background_set_image (PanelBackground *background,
const char *image);
void panel_background_set_fit (PanelBackground *background,
@@ -126,13 +99,8 @@ void panel_background_set_stretch (PanelBackground *background,
void panel_background_set_rotate (PanelBackground *background,
gboolean rotate_image);
void panel_background_set_default_style (PanelBackground *background,
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA *color,
cairo_pattern_t *pattern);
-#else
- GdkColor *color,
- GdkPixmap *pixmap);
-#endif
void panel_background_realized (PanelBackground *background,
GdkWindow *window);
void panel_background_unrealized (PanelBackground *background);
@@ -147,21 +115,11 @@ char *panel_background_make_string (PanelBackground *background,
int y);
PanelBackgroundType panel_background_get_type (PanelBackground *background);
-#if GTK_CHECK_VERSION (3, 0, 0)
const GdkRGBA *panel_background_get_color (PanelBackground *background);
-#else
-const PanelColor *panel_background_get_color (PanelBackground *background);
-const GdkPixmap *panel_background_get_pixmap (PanelBackground *background);
-#endif
PanelBackgroundType
panel_background_effective_type (PanelBackground *background);
-#if GTK_CHECK_VERSION (3, 0, 0)
void panel_background_apply_css(PanelBackground *background, GtkWidget *widget);
-#else
-void panel_background_change_background_on_widget (PanelBackground *background,
- GtkWidget *widget);
-#endif
#endif /* __PANEL_BACKGROUND_H__ */
diff --git a/mate-panel/panel-context-menu.c b/mate-panel/panel-context-menu.c
index 85288ef5..e249ffb3 100644
--- a/mate-panel/panel-context-menu.c
+++ b/mate-panel/panel-context-menu.c
@@ -70,7 +70,7 @@ panel_context_menu_check_for_screen (GtkWidget *w,
times++;
if (times == 3) {
times = 0;
-#if !GTK_CHECK_VERSION (3, 0, 0)
+#if 0
/* FIXME re-add once GTK3 support is fixed */
start_screen_check ();
#endif
@@ -310,7 +310,6 @@ panel_context_menu_create (PanelWidget *panel)
g_object_set_data (G_OBJECT (retval), "menu_panel", panel);
/* Set up theme and transparency support */
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *toplevel = gtk_widget_get_toplevel (retval);
/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
@@ -321,7 +320,6 @@ panel_context_menu_create (PanelWidget *panel)
context = gtk_widget_get_style_context (GTK_WIDGET(toplevel));
gtk_style_context_add_class(context,"gnome-panel-menu-bar");
gtk_style_context_add_class(context,"mate-panel-menu-bar");
-#endif
return retval;
}
diff --git a/mate-panel/panel-ditem-editor.c b/mate-panel/panel-ditem-editor.c
index 3d83aa57..737925fd 100644
--- a/mate-panel/panel-ditem-editor.c
+++ b/mate-panel/panel-ditem-editor.c
@@ -62,11 +62,7 @@ struct _PanelDItemEditorPrivate
PanelDitemSaveUri save_uri;
gpointer save_uri_data;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *grid;
-#else
- GtkWidget *table;
-#endif
GtkWidget *type_label;
GtkWidget *type_combo;
GtkWidget *name_label;
@@ -520,7 +516,6 @@ label_new_with_mnemonic (const char *text)
}
static inline void
-#if GTK_CHECK_VERSION (3, 0, 0)
grid_attach_label (GtkGrid *grid, GtkWidget *label, int left, int top, int width, int height)
{
gtk_grid_attach (grid, label, left, top, width, height);
@@ -532,32 +527,6 @@ grid_attach_entry (GtkGrid *grid, GtkWidget *entry, int left, int top, int width
gtk_widget_set_hexpand (entry, TRUE);
gtk_grid_attach (grid, entry, left, top, width, height);
}
-#else
-table_attach_label (GtkTable *table,
- GtkWidget *label,
- int left,
- int right,
- int top,
- int bottom)
-{
- gtk_table_attach (table, label, left, right, top, bottom,
- GTK_FILL, GTK_FILL,
- 0, 0);
-}
-
-static inline void
-table_attach_entry (GtkTable *table,
- GtkWidget *entry,
- int left,
- int right,
- int top,
- int bottom)
-{
- gtk_table_attach (table, entry, left, right, top, bottom,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_FILL,
- 0, 0);
-}
-#endif
static void
setup_combo (GtkWidget *combo_box,
@@ -630,22 +599,12 @@ panel_ditem_editor_make_ui (PanelDItemEditor *dialog)
dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_set_spacing (GTK_BOX (dialog_vbox), 2);
-#if GTK_CHECK_VERSION (3, 0, 0)
priv->grid = gtk_grid_new ();
gtk_container_set_border_width (GTK_CONTAINER (priv->grid), 5);
gtk_grid_set_row_spacing (GTK_GRID (priv->grid), 6);
gtk_grid_set_column_spacing (GTK_GRID (priv->grid), 12);
gtk_box_pack_start (GTK_BOX (dialog_vbox), priv->grid, TRUE, TRUE, 0);
gtk_widget_show (priv->grid);
-#else
- priv->table = gtk_table_new (4, 3, FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (priv->table), 5);
- gtk_table_set_row_spacings (GTK_TABLE (priv->table), 6);
- gtk_table_set_col_spacings (GTK_TABLE (priv->table), 12);
- gtk_box_pack_start (GTK_BOX (dialog_vbox),
- priv->table, TRUE, TRUE, 0);
- gtk_widget_show (priv->table);
-#endif
/* Type */
priv->type_label = label_new_with_mnemonic (_("_Type:"));
@@ -665,23 +624,13 @@ panel_ditem_editor_make_ui (PanelDItemEditor *dialog)
priv->icon_chooser = panel_icon_chooser_new (NULL);
panel_icon_chooser_set_fallback_icon_name (PANEL_ICON_CHOOSER (priv->icon_chooser),
PANEL_ICON_LAUNCHER);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (priv->grid), priv->icon_chooser, 0, 0, 1, 2);
-#else
- gtk_table_attach (GTK_TABLE (priv->table), priv->icon_chooser,
- 0, 1, 0, 2,
- 0, 0, 0, 0);
-#endif
gtk_widget_show (priv->icon_chooser);
/* Command */
priv->command_label = label_new_with_mnemonic ("");
-#if GTK_CHECK_VERSION (3, 0, 0)
priv->command_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-#else
- priv->command_hbox = gtk_hbox_new (FALSE, 12);
-#endif
gtk_widget_show (priv->command_hbox);
priv->command_entry = gtk_entry_new ();
@@ -772,7 +721,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog)
GtkTreeModel *model;
PanelDItemEditorType buf_type;
-#if GTK_CHECK_VERSION (3, 0, 0)
grid_attach_label (GTK_GRID (priv->grid), priv->type_label, 1, 0, 1, 1);
grid_attach_entry (GTK_GRID (priv->grid), priv->type_combo, 2, 0, 1, 1);
@@ -784,27 +732,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog)
grid_attach_label (GTK_GRID (priv->grid), priv->comment_label, 1, 3, 1, 1);
grid_attach_entry (GTK_GRID (priv->grid), priv->comment_entry, 2, 3, 1, 1);
-#else
- table_attach_label (GTK_TABLE (priv->table), priv->type_label,
- 1, 2, 0, 1);
- table_attach_entry (GTK_TABLE (priv->table), priv->type_combo,
- 2, 3, 0, 1);
-
- table_attach_label (GTK_TABLE (priv->table), priv->name_label,
- 1, 2, 1, 2);
- table_attach_entry (GTK_TABLE (priv->table), priv->name_entry,
- 2, 3, 1, 2);
-
- table_attach_label (GTK_TABLE (priv->table), priv->command_label,
- 1, 2, 2, 3);
- table_attach_entry (GTK_TABLE (priv->table), priv->command_hbox,
- 2, 3, 2, 3);
-
- table_attach_label (GTK_TABLE (priv->table), priv->comment_label,
- 1, 2, 3, 4);
- table_attach_entry (GTK_TABLE (priv->table), priv->comment_entry,
- 2, 3, 3, 4);
-#endif
/* FIXME: hack hack hack */
model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->type_combo));
@@ -820,7 +747,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog)
}
} while (gtk_tree_model_iter_next (model, &iter));
} else if (type == PANEL_DITEM_EDITOR_TYPE_DIRECTORY) {
-#if GTK_CHECK_VERSION (3, 0, 0)
grid_attach_label (GTK_GRID (priv->grid), priv->name_label, 1, 0, 1, 1);
grid_attach_entry (GTK_GRID (priv->grid), priv->name_entry, 2, 0, 1, 1);
@@ -835,32 +761,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog)
grid_attach_label (GTK_GRID (priv->grid), priv->comment_label, 1, 2, 1, 1);
grid_attach_entry (GTK_GRID (priv->grid), priv->comment_entry, 2, 2, 1, 1);
-#else
- table_attach_label (GTK_TABLE (priv->table), priv->name_label,
- 1, 2, 0, 1);
- table_attach_entry (GTK_TABLE (priv->table), priv->name_entry,
- 2, 3, 0, 1);
-
- table_attach_label (GTK_TABLE (priv->table), priv->comment_label,
- 1, 2, 1, 2);
- table_attach_entry (GTK_TABLE (priv->table), priv->comment_entry,
- 2, 3, 1, 2);
- } else {
- table_attach_label (GTK_TABLE (priv->table), priv->name_label,
- 1, 2, 0, 1);
- table_attach_entry (GTK_TABLE (priv->table), priv->name_entry,
- 2, 3, 0, 1);
-
- table_attach_label (GTK_TABLE (priv->table), priv->command_label,
- 1, 2, 1, 2);
- table_attach_entry (GTK_TABLE (priv->table), priv->command_hbox,
- 2, 3, 1, 2);
-
- table_attach_label (GTK_TABLE (priv->table), priv->comment_label,
- 1, 2, 2, 3);
- table_attach_entry (GTK_TABLE (priv->table), priv->comment_entry,
- 2, 3, 2, 3);
-#endif
}
type_combo_changed (dialog);
@@ -874,12 +774,7 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog)
focus_chain = g_list_prepend (focus_chain, priv->command_hbox);
focus_chain = g_list_prepend (focus_chain, priv->comment_entry);
focus_chain = g_list_reverse (focus_chain);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_set_focus_chain (GTK_CONTAINER (priv->grid), focus_chain);
-#else
- gtk_container_set_focus_chain (GTK_CONTAINER (priv->table),
- focus_chain);
-#endif
g_list_free (focus_chain);
gtk_widget_grab_focus (priv->name_entry);
diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c
index bc4809fd..8f99d5f1 100644
--- a/mate-panel/panel-force-quit.c
+++ b/mate-panel/panel-force-quit.c
@@ -65,23 +65,15 @@ display_popup_window (GdkScreen *screen)
gtk_container_add (GTK_CONTAINER (retval), frame);
gtk_widget_show (frame);
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-#else
- vbox = gtk_vbox_new (FALSE, 0);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
image = gtk_image_new_from_icon_name (PANEL_ICON_FORCE_QUIT,
GTK_ICON_SIZE_DIALOG);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_halign (image, GTK_ALIGN_CENTER);
gtk_widget_set_valign (image, GTK_ALIGN_CENTER);
-#else
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), image, TRUE, TRUE, 4);
gtk_widget_show (image);
@@ -112,7 +104,6 @@ static void
remove_popup (GtkWidget *popup)
{
GdkWindow *root;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
#if GTK_CHECK_VERSION (3, 20, 0)
GdkSeat *seat;
@@ -121,15 +112,12 @@ remove_popup (GtkWidget *popup)
GdkDevice *keyboard;
GdkDeviceManager *device_manager;
#endif
-#endif
-
root = gdk_screen_get_root_window (
gtk_window_get_screen (GTK_WINDOW (popup)));
gdk_window_remove_filter (root, (GdkFilterFunc) popup_filter, popup);
gtk_widget_destroy (popup);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_window_get_display (root);
#if GTK_CHECK_VERSION (3, 20, 0)
seat = gdk_display_get_default_seat (display);
@@ -143,10 +131,6 @@ remove_popup (GtkWidget *popup)
gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
gdk_device_ungrab (keyboard, GDK_CURRENT_TIME);
#endif
-#else
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- gdk_keyboard_ungrab (GDK_CURRENT_TIME);
-#endif
}
static gboolean
@@ -232,11 +216,7 @@ kill_window_response (GtkDialog *dialog,
gdk_error_trap_push ();
XKillClient (display, window);
gdk_flush ();
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
-#else
- gdk_error_trap_pop ();
-#endif
}
gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -348,7 +328,6 @@ panel_force_quit (GdkScreen *screen,
GdkCursor *cross;
GtkWidget *popup;
GdkWindow *root;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
GdkDevice *pointer;
GdkDevice *keyboard;
@@ -357,7 +336,6 @@ panel_force_quit (GdkScreen *screen,
#else
GdkDeviceManager *device_manager;
#endif
-#endif
popup = display_popup_window (screen);
@@ -366,7 +344,6 @@ panel_force_quit (GdkScreen *screen,
gdk_window_add_filter (root, (GdkFilterFunc) popup_filter, popup);
cross = gdk_cursor_new_for_display (gdk_display_get_default (),
GDK_CROSS);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_window_get_display (root);
#if GTK_CHECK_VERSION (3, 20, 0)
seat = gdk_display_get_default_seat (display);
@@ -394,24 +371,6 @@ panel_force_quit (GdkScreen *screen,
remove_popup (popup);
return;
}
-#else
- status = gdk_pointer_grab (root, FALSE, GDK_BUTTON_PRESS_MASK,
- NULL, cross, time);
-
- gdk_cursor_unref (cross);
-
- if (status != GDK_GRAB_SUCCESS) {
- g_warning ("Pointer grab failed\n");
- remove_popup (popup);
- return;
- }
- status = gdk_keyboard_grab (root, FALSE, time);
- if (status != GDK_GRAB_SUCCESS) {
- g_warning ("Keyboard grab failed\n");
- remove_popup (popup);
- return;
- }
-#endif
gdk_flush ();
}
diff --git a/mate-panel/panel-frame.c b/mate-panel/panel-frame.c
index b0529f1d..ca395520 100644
--- a/mate-panel/panel-frame.c
+++ b/mate-panel/panel-frame.c
@@ -35,7 +35,6 @@ enum {
PROP_EDGES
};
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
panel_frame_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
@@ -109,53 +108,14 @@ panel_frame_get_preferred_height (GtkWidget *widget,
}
}
-#else
-static void
-panel_frame_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- PanelFrame *frame = (PanelFrame *) widget;
- GtkBin *bin = (GtkBin *) widget;
- GtkStyle *style;
- GtkWidget *child;
- int border_width;
-
- style = gtk_widget_get_style (widget);
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-
- requisition->width = 1;
- requisition->height = 1;
-
- child = gtk_bin_get_child (bin);
- if (child && gtk_widget_get_visible (child))
- gtk_widget_size_request (child, requisition);
-
- requisition->width += border_width;
- requisition->height += border_width;
-
- if (frame->edges & PANEL_EDGE_TOP)
- requisition->height += style->xthickness;
- if (frame->edges & PANEL_EDGE_BOTTOM)
- requisition->height += style->xthickness;
- if (frame->edges & PANEL_EDGE_LEFT)
- requisition->width += style->ythickness;
- if (frame->edges & PANEL_EDGE_RIGHT)
- requisition->width += style->ythickness;
-}
-#endif
-
static void
panel_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
PanelFrame *frame = (PanelFrame *) widget;
GtkBin *bin = (GtkBin *) widget;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkBorder padding;
-#else
- GtkStyle *style;
-#endif
GtkAllocation child_allocation;
GtkAllocation child_allocation_current;
GtkWidget *child;
@@ -163,12 +123,8 @@ panel_frame_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
-#if GTK_CHECK_VERSION (3, 0, 0)
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_padding (context, gtk_widget_get_state_flags (widget), &padding);
-#else
- style = gtk_widget_get_style (widget);
-#endif
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
child_allocation.x = allocation->x + border_width;
@@ -177,38 +133,20 @@ panel_frame_size_allocate (GtkWidget *widget,
child_allocation.height = allocation->height - 2 * border_width;
if (frame->edges & PANEL_EDGE_LEFT) {
-#if GTK_CHECK_VERSION (3, 0, 0)
child_allocation.x += padding.left;
child_allocation.width -= padding.left;
-#else
- child_allocation.x += style->xthickness;
- child_allocation.width -= style->xthickness;
-#endif
}
if (frame->edges & PANEL_EDGE_TOP) {
-#if GTK_CHECK_VERSION (3, 0, 0)
child_allocation.y += padding.top;
child_allocation.height -= padding.top;
-#else
- child_allocation.y += style->ythickness;
- child_allocation.height -= style->ythickness;
-#endif
}
if (frame->edges & PANEL_EDGE_RIGHT)
-#if GTK_CHECK_VERSION (3, 0, 0)
child_allocation.width -= padding.left;
-#else
- child_allocation.width -= style->xthickness;
-#endif
if (frame->edges & PANEL_EDGE_BOTTOM)
-#if GTK_CHECK_VERSION (3, 0, 0)
child_allocation.height -= padding.top;
-#else
- child_allocation.height -= style->ythickness;
-#endif
child = gtk_bin_get_child (bin);
gtk_widget_get_allocation (child, &child_allocation_current);
@@ -226,33 +164,21 @@ panel_frame_size_allocate (GtkWidget *widget,
void
panel_frame_draw (GtkWidget *widget,
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr,
-#endif
PanelFrameEdge edges)
{
PanelFrame *frame = (PanelFrame *) widget;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkStateFlags state;
GdkRGBA *bg;
GdkRGBA dark, light;
GtkBorder padding;
-#else
- GdkWindow *window;
- GtkStyle *style;
- GtkStateType state;
- GtkAllocation allocation;
- GdkGC *dark, *light, *black;
- int xthickness, ythickness;
-#endif
int x, y, width, height;
if (edges == PANEL_EDGE_NONE)
return;
-#if GTK_CHECK_VERSION (3, 0, 0)
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
@@ -267,29 +193,11 @@ panel_frame_draw (GtkWidget *widget,
gtk_style_shade (bg, &light, 1.3);
gtk_style_context_get_padding (context, state, &padding);
-#else
- window = gtk_widget_get_window (widget);
- style = gtk_widget_get_style (widget);
- state = gtk_widget_get_state (widget);
-
- gtk_widget_get_allocation (widget, &allocation);
- x = allocation.x;
- y = allocation.y;
- width = allocation.width;
- height = allocation.height;
-
- dark = style->dark_gc [state];
- light = style->light_gc [state];
- black = style->black_gc;
-
- xthickness = style->xthickness;
- ythickness = style->ythickness;
-#endif
+
/* Copied from gtk_default_draw_shadow() */
x = y = 0;
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_set_line_width (cr, 1);
if (frame->edges & PANEL_EDGE_BOTTOM && padding.bottom > 0) {
@@ -357,63 +265,9 @@ panel_frame_draw (GtkWidget *widget,
cairo_stroke (cr);
}
}
-#else
- if (frame->edges & PANEL_EDGE_BOTTOM && ythickness > 0) {
- if (ythickness > 1) {
- gdk_draw_line (window, dark,
- x, y + height - 2,
- x + width - 1, y + height - 2);
- gdk_draw_line (window, black,
- x, y + height - 1,
- x + width - 1, y + height - 1);
- } else
- gdk_draw_line (window, dark,
- x, y + height - 1,
- x + width - 1, y + height - 1);
- }
-
- if (frame->edges & PANEL_EDGE_RIGHT && xthickness > 0) {
- if (xthickness > 1) {
- gdk_draw_line (window, dark,
- x + width - 2, y,
- x + width - 2, y + height - 1);
-
- gdk_draw_line (window, black,
- x + width - 1, y,
- x + width - 1, y + height - 1);
- } else
- gdk_draw_line (window, dark,
- x + width - 1, y,
- x + width - 1, y + height - 1);
- }
-
- if (frame->edges & PANEL_EDGE_TOP && ythickness > 0) {
- gdk_draw_line (window, light,
- x, y, x + width - 1, y);
-
- if (ythickness > 1)
- gdk_draw_line (window,
- style->bg_gc [state],
- x, y + 1, x + width - 1, y + 1);
- }
-
- if (frame->edges & PANEL_EDGE_LEFT && xthickness > 0) {
- gdk_draw_line (window, light,
- x, y, x, y + height - 1);
-
- if (xthickness > 1)
- gdk_draw_line (window,
- style->bg_gc [state],
- x + 1, y, x + 1, y + height - 1);
- }
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean panel_frame_expose(GtkWidget* widget, cairo_t* cr)
-#else
-static gboolean panel_frame_expose(GtkWidget* widget, GdkEventExpose* event)
-#endif
{
PanelFrame *frame = (PanelFrame *) widget;
gboolean retval = FALSE;
@@ -421,19 +275,10 @@ static gboolean panel_frame_expose(GtkWidget* widget, GdkEventExpose* event)
if (!gtk_widget_is_drawable (widget))
return retval;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (GTK_WIDGET_CLASS (panel_frame_parent_class)->draw)
retval = GTK_WIDGET_CLASS (panel_frame_parent_class)->draw (widget, cr);
-#else
- if (GTK_WIDGET_CLASS (panel_frame_parent_class)->expose_event)
- retval = GTK_WIDGET_CLASS (panel_frame_parent_class)->expose_event (widget, event);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_frame_draw (widget, cr, frame->edges);
-#else
- panel_frame_draw (widget, frame->edges);
-#endif
return retval;
}
@@ -492,14 +337,9 @@ panel_frame_class_init (PanelFrameClass *klass)
gobject_class->get_property = panel_frame_get_property;
widget_class->size_allocate = panel_frame_size_allocate;
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->get_preferred_width = panel_frame_get_preferred_width;
widget_class->get_preferred_height = panel_frame_get_preferred_height;
widget_class->draw = panel_frame_expose;
-#else
- widget_class->size_request = panel_frame_size_request;
- widget_class->expose_event = panel_frame_expose;
-#endif
#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_class_set_css_name (widget_class, "PanelFrame");
#endif
diff --git a/mate-panel/panel-frame.h b/mate-panel/panel-frame.h
index e5988ddb..f73ebc15 100644
--- a/mate-panel/panel-frame.h
+++ b/mate-panel/panel-frame.h
@@ -60,9 +60,7 @@ void panel_frame_set_edges (PanelFrame *toplevel,
PanelFrameEdge panel_frame_get_edges (PanelFrame *toplevel);
void panel_frame_draw (GtkWidget *widget,
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr,
-#endif
PanelFrameEdge edges);
#ifdef __cplusplus
diff --git a/mate-panel/panel-menu-bar.c b/mate-panel/panel-menu-bar.c
index c926e5a0..c95533d7 100644
--- a/mate-panel/panel-menu-bar.c
+++ b/mate-panel/panel-menu-bar.c
@@ -143,13 +143,10 @@ static void panel_menu_bar_update_visibility (GSettings* settings, gchar* key, P
static void panel_menu_bar_init(PanelMenuBar* menubar)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkCssProvider *provider;
-#endif
menubar->priv = PANEL_MENU_BAR_GET_PRIVATE(menubar);
-#if GTK_CHECK_VERSION (3, 0, 0)
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider,
"PanelMenuBar {\n"
@@ -160,7 +157,6 @@ static void panel_menu_bar_init(PanelMenuBar* menubar)
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
-#endif
menubar->priv->info = NULL;
@@ -315,19 +311,8 @@ static void panel_menu_bar_class_init(PanelMenuBarClass* klass)
g_type_class_add_private(klass, sizeof(PanelMenuBarPrivate));
g_object_class_install_property(gobject_class, PROP_ORIENTATION, g_param_spec_enum("orientation", "Orientation", "The PanelMenuBar orientation", PANEL_TYPE_ORIENTATION, PANEL_ORIENTATION_TOP, G_PARAM_READWRITE));
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_rc_parse_string (
- "style \"panel-menubar-style\"\n"
- "{\n"
- " GtkMenuBar::shadow-type = none\n"
- " GtkMenuBar::internal-padding = 0\n"
- "}\n"
- "class \"PanelMenuBar\" style \"panel-menubar-style\"");
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean panel_menu_bar_on_draw (GtkWidget* widget, cairo_t* cr, gpointer data)
{
PanelMenuBar* menubar = data;
@@ -351,28 +336,6 @@ static gboolean panel_menu_bar_on_draw (GtkWidget* widget, cairo_t* cr, gpointer
return FALSE;
}
-#else
-static gboolean panel_menu_bar_on_expose (GtkWidget* widget, GdkEventExpose* event, gpointer data)
-{
- PanelMenuBar* menubar = data;
-
- if (gtk_widget_has_focus(GTK_WIDGET(menubar)))
- {
- gtk_paint_focus(gtk_widget_get_style(widget),
- gtk_widget_get_window(widget),
- gtk_widget_get_state(GTK_WIDGET(menubar)),
- NULL,
- widget,
- "menubar-applet",
- 0,
- 0,
- -1,
- -1);
- }
-
- return FALSE;
-}
-#endif
static void panel_menu_bar_load(PanelWidget* panel, gboolean locked, int position, gboolean exactpos, const char* id)
{
PanelMenuBar* menubar;
@@ -399,11 +362,7 @@ static void panel_menu_bar_load(PanelWidget* panel, gboolean locked, int positio
g_signal_connect_after(menubar, "focus-in-event", G_CALLBACK(gtk_widget_queue_draw), menubar);
g_signal_connect_after(menubar, "focus-out-event", G_CALLBACK(gtk_widget_queue_draw), menubar);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_after(menubar, "draw", G_CALLBACK(panel_menu_bar_on_draw), menubar);
-#else
- g_signal_connect_after(menubar, "expose-event", G_CALLBACK(panel_menu_bar_on_expose), menubar);
-#endif
gtk_widget_set_can_focus(GTK_WIDGET(menubar), TRUE);
@@ -471,16 +430,6 @@ void panel_menu_bar_popup_menu(PanelMenuBar* menubar, guint32 activate_time)
*/
menu_shell = GTK_MENU_SHELL(menubar);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- if (!menu_shell->active)
- {
- gtk_grab_add(GTK_WIDGET(menu_shell));
-
- menu_shell->have_grab = TRUE;
- menu_shell->active = TRUE;
- }
-#endif
-
gtk_menu_shell_select_item(menu_shell, gtk_menu_get_attach_widget(menu));
}
@@ -488,10 +437,8 @@ void panel_menu_bar_change_background(PanelMenuBar* menubar)
{
#if GTK_CHECK_VERSION (3, 18, 0)
panel_background_apply_css(&menubar->priv->panel->toplevel->background, GTK_WIDGET(menubar));
-#elif GTK_CHECK_VERSION (3, 0, 0)
- panel_background_apply_css(&menubar->priv->panel->background, GTK_WIDGET(menubar));
#else
- panel_background_change_background_on_widget(&menubar->priv->panel->background, GTK_WIDGET(menubar));
+ panel_background_apply_css(&menubar->priv->panel->background, GTK_WIDGET(menubar));
#endif
}
diff --git a/mate-panel/panel-menu-button.c b/mate-panel/panel-menu-button.c
index 4fefee80..a35dba88 100644
--- a/mate-panel/panel-menu-button.c
+++ b/mate-panel/panel-menu-button.c
@@ -359,12 +359,8 @@ panel_menu_button_menu_deactivated (PanelMenuButton *button)
{
panel_toplevel_pop_autohide_disabler (button->priv->toplevel);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_unset_state_flags (GTK_WIDGET (button),
GTK_STATE_FLAG_PRELIGHT);
-#else
- GTK_BUTTON (button)->in_button = FALSE;
-#endif
button_widget_set_ignore_leave (BUTTON_WIDGET (button), FALSE);
}
diff --git a/mate-panel/panel-menu-button.h b/mate-panel/panel-menu-button.h
index 7bdd713f..829744b3 100644
--- a/mate-panel/panel-menu-button.h
+++ b/mate-panel/panel-menu-button.h
@@ -25,7 +25,6 @@
#ifndef __PANEL_MENU_BUTTON_H__
#define __PANEL_MENU_BUTTON_H__
-#include <gtk/gtk.h>
#include "button-widget.h"
#include "panel-widget.h"
diff --git a/mate-panel/panel-menu-items.c b/mate-panel/panel-menu-items.c
index e16e9edc..0e758254 100644
--- a/mate-panel/panel-menu-items.c
+++ b/mate-panel/panel-menu-items.c
@@ -1127,12 +1127,11 @@ panel_place_menu_item_create_menu (PanelPlaceMenuItem *place_item)
panel_recent_append_documents_menu (places_menu,
place_item->priv->recent_manager);
/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *toplevel = gtk_widget_get_toplevel (places_menu);
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
gtk_widget_set_visual(GTK_WIDGET(toplevel), visual);
-#endif
+
return places_menu;
}
diff --git a/mate-panel/panel-multiscreen.c b/mate-panel/panel-multiscreen.c
index 8f8554f0..64dda92e 100644
--- a/mate-panel/panel-multiscreen.c
+++ b/mate-panel/panel-multiscreen.c
@@ -410,11 +410,7 @@ panel_multiscreen_init (void)
return;
display = gdk_display_get_default ();
-#if GTK_CHECK_VERSION (3, 0, 0)
screens = 1;
-#else
- screens = gdk_display_get_n_screens (display);
-#endif
panel_multiscreen_init_randr (display);
@@ -446,15 +442,8 @@ panel_multiscreen_init (void)
void
panel_multiscreen_reinit (void)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkScreen *screen;
GList *toplevels, *l;
-#else
- GdkDisplay *display;
- GList *toplevels, *l;
- int new_screens;
- int i;
-#endif
if (monitors)
g_free (monitors);
@@ -467,24 +456,8 @@ panel_multiscreen_reinit (void)
g_free (geometries);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
screen = gdk_screen_get_default ();
g_signal_handlers_disconnect_by_func (screen, panel_multiscreen_queue_reinit, NULL);
-#else
- display = gdk_display_get_default ();
- /* Don't use the screens variable since in the future, we might
- * want to call this function when a screen appears/disappears. */
- new_screens = gdk_display_get_n_screens (display);
-
- for (i = 0; i < new_screens; i++) {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
- g_signal_handlers_disconnect_by_func (screen,
- panel_multiscreen_queue_reinit,
- NULL);
- }
-#endif
initialized = FALSE;
panel_multiscreen_init ();
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c
index e63a0feb..2b7784d4 100644
--- a/mate-panel/panel-profile.c
+++ b/mate-panel/panel-profile.c
@@ -231,7 +231,6 @@ panel_profile_get_background_type (PanelToplevel *toplevel)
return background_type;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
void
panel_profile_set_background_color (PanelToplevel *toplevel,
GdkRGBA *color)
@@ -293,70 +292,6 @@ panel_profile_get_background_opacity (PanelToplevel *toplevel)
panel_profile_get_background_color (toplevel, &color);
return (guint16) round (color.alpha * 65535);
}
-#else
-void
-panel_profile_set_background_color (PanelToplevel *toplevel,
- PanelColor *color)
-{
- panel_profile_set_background_gdk_color (toplevel, &color->gdk);
- panel_profile_set_background_opacity (toplevel, color->alpha);
-}
-
-void
-panel_profile_get_background_color (PanelToplevel *toplevel,
- PanelColor *color)
-{
- panel_profile_get_background_gdk_color (toplevel, &(color->gdk));
- color->alpha = panel_profile_get_background_opacity (toplevel);
-}
-
-void
-panel_profile_set_background_gdk_color (PanelToplevel *toplevel,
- GdkColor *gdk_color)
-{
- char *color_str;
-
- color_str = g_strdup_printf ("#%02x%02x%02x",
- gdk_color->red / 256,
- gdk_color->green / 256,
- gdk_color->blue / 256);
-
- g_settings_set_string (toplevel->background_settings, "color", color_str);
-
- g_free (color_str);
-}
-
-void
-panel_profile_get_background_gdk_color (PanelToplevel *toplevel,
- GdkColor *gdk_color)
-{
- char *color_str;
-
- color_str = g_settings_get_string (toplevel->background_settings, "color");
- if (!color_str || !gdk_color_parse (color_str, gdk_color)) {
- gdk_color->red = 0;
- gdk_color->green = 0;
- gdk_color->blue = 0;
- }
-
- g_free (color_str);
-}
-
-void
-panel_profile_set_background_opacity (PanelToplevel *toplevel,
- guint16 opacity)
-{
- g_settings_set_int (toplevel->background_settings, "opacity", opacity);
-}
-
-guint16
-panel_profile_get_background_opacity (PanelToplevel *toplevel)
-{
- guint16 opacity;
- opacity = g_settings_get_int (toplevel->background_settings, "opacity");
- return opacity;
-}
-#endif
void
panel_profile_set_background_image (PanelToplevel *toplevel,
@@ -554,7 +489,6 @@ panel_profile_is_writable_attached_tooltip (PanelToplevel *toplevel)
return is_writable;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
get_background_color (PanelToplevel *toplevel,
GdkRGBA *color)
@@ -570,24 +504,6 @@ get_background_color (PanelToplevel *toplevel,
g_free (color_str);
}
-#else
-static void
-get_background_color (PanelToplevel *toplevel,
- PanelColor *color)
-{
- char *color_str;
- color_str = g_settings_get_string (toplevel->background_settings, "color");
- if (!color_str || !gdk_color_parse (color_str, &(color->gdk))) {
- color->gdk.red = 0;
- color->gdk.green = 0;
- color->gdk.blue = 0;
- }
-
- g_free (color_str);
-
- color->alpha = g_settings_get_int (toplevel->background_settings, "opacity");
-}
-#endif
static char *
get_background_image (PanelToplevel *toplevel,
@@ -609,11 +525,7 @@ panel_profile_load_background (PanelToplevel *toplevel)
PanelWidget *panel_widget;
PanelBackground *background;
PanelBackgroundType background_type;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- PanelColor color;
-#endif
char *image;
gboolean fit;
gboolean stretch;
@@ -921,24 +833,12 @@ panel_profile_background_change_notify (GSettings *settings,
panel_background_set_type (background, background_type);
panel_toplevel_update_edges (toplevel);
} else if (!strcmp (key, "color")) {
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
gchar *str;
str = g_settings_get_string (settings, key);
if (gdk_rgba_parse (&color, str))
panel_background_set_color (background, &color);
g_free (str);
-#else
- GdkColor gdk_color;
- gchar *str;
- str = g_settings_get_string (settings, key);
- if (gdk_color_parse (str, &gdk_color))
- panel_background_set_gdk_color (background, &gdk_color);
- g_free (str);
- } else if (!strcmp (key, "opacity")) {
- panel_background_set_opacity (background,
- g_settings_get_int (settings, key));
-#endif
} else if (!strcmp (key, "image")) {
gchar *value = g_settings_get_string (settings, key);
panel_background_set_image (background, value);
@@ -1151,33 +1051,6 @@ panel_profile_delete_toplevel (PanelToplevel *toplevel)
panel_profile_remove_from_list (PANEL_GSETTINGS_TOPLEVELS, toplevel_id);
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static GdkScreen *
-get_toplevel_screen (char *toplevel_path)
-{
- GdkDisplay *display;
- GSettings *settings;
- int screen_n;
-
- settings = g_settings_new_with_path (PANEL_TOPLEVEL_SCHEMA, toplevel_path);
- screen_n = g_settings_get_int (settings, "screen");
- g_object_unref (settings);
-
- display = gdk_display_get_default ();
-
- if (screen_n < 0 || screen_n >= gdk_display_get_n_screens (display)) {
-#if 0
- g_warning (_("Panel '%s' is set to be displayed on screen %d which "
- "is not currently available. Not loading this panel."),
- toplevel_dir, screen_n);
-#endif
- return NULL;
- }
-
- return gdk_display_get_screen (display, screen_n);
-}
-#endif
-
PanelToplevel *
panel_profile_load_toplevel (const char *toplevel_id)
{
@@ -1191,11 +1064,7 @@ panel_profile_load_toplevel (const char *toplevel_id)
toplevel_path = g_strdup_printf ("%s%s/", PANEL_TOPLEVEL_PATH, toplevel_id);
-#if GTK_CHECK_VERSION (3, 0, 0)
screen = gdk_display_get_default_screen (gdk_display_get_default ());
-#else
- screen = get_toplevel_screen (toplevel_path);
-#endif
if (screen == NULL) {
g_free (toplevel_path);
@@ -1713,15 +1582,11 @@ panel_profile_ensure_toplevel_per_screen ()
GSList *l;
GdkDisplay *display;
GdkScreen *screen;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- int n_screens, i;
-#endif
toplevels = panel_toplevel_list_toplevels ();
display = gdk_display_get_default ();
-#if GTK_CHECK_VERSION (3, 0, 0)
screen = gdk_display_get_default_screen (display);
for (l = toplevels; l; l = l->next)
@@ -1730,19 +1595,6 @@ panel_profile_ensure_toplevel_per_screen ()
if (!l)
empty_screens = g_slist_prepend (empty_screens, screen);
-#else
- n_screens = gdk_display_get_n_screens (display);
- for (i = 0; i < n_screens; i++) {
- screen = gdk_display_get_screen (display, i);
-
- for (l = toplevels; l; l = l->next)
- if (gtk_window_get_screen (l->data) == screen)
- break;
-
- if (!l)
- empty_screens = g_slist_prepend (empty_screens, screen);
- }
-#endif
for (l = empty_screens; l; l = l->next)
panel_layout_apply_default_from_gkeyfile (l->data);
diff --git a/mate-panel/panel-profile.h b/mate-panel/panel-profile.h
index ff690527..3648d82d 100644
--- a/mate-panel/panel-profile.h
+++ b/mate-panel/panel-profile.h
@@ -110,29 +110,14 @@ PanelBackgroundType
panel_profile_get_background_type (PanelToplevel *toplevel);
void panel_profile_set_background_color (PanelToplevel *toplevel,
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA *color);
-#else
- PanelColor *color);
-#endif
void panel_profile_get_background_color (PanelToplevel *toplevel,
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA *color);
-#else
- PanelColor *color);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
void panel_profile_set_background_gdk_rgba (PanelToplevel *toplevel,
GdkRGBA *color);
void panel_profile_get_background_gdk_rgba (PanelToplevel *toplevel,
GdkRGBA *color);
-#else
-void panel_profile_set_background_gdk_color (PanelToplevel *toplevel,
- GdkColor *gdk_color);
-void panel_profile_get_background_gdk_color (PanelToplevel *toplevel,
- GdkColor *gdk_color);
-#endif
void panel_profile_set_background_opacity (PanelToplevel *toplevel,
guint16 opacity);
diff --git a/mate-panel/panel-properties-dialog.c b/mate-panel/panel-properties-dialog.c
index b45c0188..d2c5c8d0 100644
--- a/mate-panel/panel-properties-dialog.c
+++ b/mate-panel/panel-properties-dialog.c
@@ -36,10 +36,6 @@
#include <libpanel-util/panel-icon-chooser.h>
#include <libpanel-util/panel-show.h>
-#if !GTK_CHECK_VERSION (3, 0, 0)
-#include <libmate-desktop/mate-colorbutton.h>
-#endif
-
#include "nothing.h"
#include "panel-profile.h"
#include "panel-schemas.h"
@@ -331,39 +327,22 @@ SETUP_TOGGLE_BUTTON ("arrows_toggle", arrows_toggle, enable_arrows,
static void
panel_properties_dialog_color_changed (PanelPropertiesDialog *dialog,
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkColorChooser *color_button)
-#else
- MateColorButton *color_button)
-#endif
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- GdkColor color;
-#endif
g_assert (dialog->color_button == GTK_WIDGET (color_button));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_color_chooser_get_rgba (color_button, &color);
panel_profile_set_background_gdk_rgba (dialog->toplevel, &color);
panel_properties_dialog_opacity_changed (dialog);
-#else
- mate_color_button_get_color (color_button, &color);
- panel_profile_set_background_gdk_color (dialog->toplevel, &color);
-#endif
}
static void
panel_properties_dialog_setup_color_button (PanelPropertiesDialog *dialog,
GtkBuilder *gui)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- PanelColor color;
-#endif
dialog->color_button = PANEL_GTK_BUILDER_GET (gui, "color_button");
g_return_if_fail (dialog->color_button != NULL);
@@ -372,13 +351,8 @@ panel_properties_dialog_setup_color_button (PanelPropertiesDialog *dialog,
panel_profile_get_background_color (dialog->toplevel, &color);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog->color_button),
&color);
-#else
- mate_color_button_set_color (MATE_COLOR_BUTTON (dialog->color_button),
- &(color.gdk));
-#endif
g_signal_connect_swapped (dialog->color_button, "color_set",
G_CALLBACK (panel_properties_dialog_color_changed),
@@ -722,7 +696,6 @@ static void
panel_properties_dialog_update_background_color (PanelPropertiesDialog *dialog,
gchar *str_color)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA new_color;
GdkRGBA old_color;
@@ -735,36 +708,8 @@ panel_properties_dialog_update_background_color (PanelPropertiesDialog *dialog,
if (!gdk_rgba_equal (&old_color, &new_color))
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog->color_button),
&new_color);
-#else
- GdkColor new_color = { 0, };
- GdkColor old_color;
-
- if (!gdk_color_parse (str_color, &new_color))
- return;
-
- mate_color_button_get_color (MATE_COLOR_BUTTON (dialog->color_button),
- &old_color);
-
- if (!gdk_color_equal (&old_color, &new_color))
- mate_color_button_set_color (MATE_COLOR_BUTTON (dialog->color_button),
- &new_color);
-#endif
}
-#if !GTK_CHECK_VERSION(3, 0, 0)
-static void
-panel_properties_dialog_update_background_opacity (PanelPropertiesDialog *dialog,
- gint opacity)
-{
- gdouble percentage;
-
- percentage = ((gdouble) (opacity * 100)) / 65535;
-
- if ((int) gtk_range_get_value (GTK_RANGE (dialog->opacity_scale)) != (int) percentage)
- gtk_range_set_value (GTK_RANGE (dialog->opacity_scale), percentage);
-}
-#endif
-
static void
panel_properties_dialog_update_background_image (PanelPropertiesDialog *dialog,
gchar *text)
@@ -800,13 +745,6 @@ panel_properties_dialog_background_notify (GSettings *settings,
panel_properties_dialog_update_background_color (dialog, color);
g_free (color);
}
-#if !GTK_CHECK_VERSION(3, 0, 0)
- else if (!strcmp (key, "opacity"))
- {
- gint opacity = g_settings_get_int (settings, key);
- panel_properties_dialog_update_background_opacity (dialog, opacity);
- }
-#endif
else if (!strcmp (key, "image"))
{
char *image = g_settings_get_string (settings, key);
@@ -819,11 +757,7 @@ static void
panel_properties_dialog_remove_orientation_combo (PanelPropertiesDialog *dialog)
{
GtkContainer *container = GTK_CONTAINER (dialog->general_table);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkGrid *grid = GTK_GRID (dialog->general_table);
-#else
- GtkTable *table = GTK_TABLE (dialog->general_table);
-#endif
g_object_ref (dialog->size_label);
g_object_ref (dialog->size_widgets);
@@ -837,17 +771,10 @@ panel_properties_dialog_remove_orientation_combo (PanelPropertiesDialog *dialog)
gtk_container_remove (container, dialog->icon_label);
gtk_container_remove (container, dialog->icon_align);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (grid, dialog->size_label, 0, 1, 1, 1);
gtk_grid_attach (grid, dialog->size_widgets, 1, 1, 1, 1);
gtk_grid_attach (grid, dialog->icon_label, 0, 2, 1, 1);
gtk_grid_attach (grid, dialog->icon_align, 1, 2, 1, 1);
-#else
- gtk_table_attach_defaults (table, dialog->size_label, 0, 1, 1, 2);
- gtk_table_attach_defaults (table, dialog->size_widgets, 1, 2, 1, 2);
- gtk_table_attach_defaults (table, dialog->icon_label, 0, 1, 2, 3);
- gtk_table_attach_defaults (table, dialog->icon_align, 1, 2, 2, 3);
-#endif
dialog->orientation_label = NULL;
dialog->orientation_combo = NULL;
@@ -855,10 +782,6 @@ panel_properties_dialog_remove_orientation_combo (PanelPropertiesDialog *dialog)
g_object_unref (dialog->size_widgets);
g_object_unref (dialog->icon_label);
g_object_unref (dialog->icon_align);
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_table_resize (table, 3, 2);
-#endif
}
static void
@@ -872,10 +795,6 @@ panel_properties_dialog_remove_icon_chooser (PanelPropertiesDialog *dialog)
dialog->icon_label = NULL;
dialog->icon_align = NULL;
dialog->icon_chooser = NULL;
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gtk_table_resize (GTK_TABLE (dialog->general_table), 3, 2);
-#endif
}
static void
@@ -983,7 +902,7 @@ panel_properties_dialog_new (PanelToplevel *toplevel,
panel_widget_register_open_dialog (panel_toplevel_get_panel_widget (dialog->toplevel),
dialog->properties_dialog);
-#if !GTK_CHECK_VERSION (3, 0, 0)
+#if 0
/* FIXME re-add once GTK3 support is fixed */
g_signal_connect (dialog->properties_dialog, "event",
G_CALLBACK (config_event),
@@ -1018,25 +937,15 @@ panel_properties_dialog_present (PanelToplevel *toplevel)
gtk_builder_set_translation_domain (gui, GETTEXT_PACKAGE);
error = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_builder_add_from_file (gui,
BUILDERDIR "/panel-properties-dialog-gtk3.ui",
&error);
-#else
- gtk_builder_add_from_file (gui,
- BUILDERDIR "/panel-properties-dialog.ui",
- &error);
-#endif
if (error) {
char *secondary;
secondary = g_strdup_printf (_("Unable to load file '%s': %s."),
-#if GTK_CHECK_VERSION (3, 0, 0)
BUILDERDIR"/panel-properties-dialog-gtk3.ui",
-#else
- BUILDERDIR"/panel-properties-dialog.ui",
-#endif
error->message);
panel_error_dialog (GTK_WINDOW (toplevel),
gtk_window_get_screen (GTK_WINDOW (toplevel)),
diff --git a/mate-panel/panel-properties-dialog.ui b/mate-panel/panel-properties-dialog.ui
deleted file mode 100644
index e57969d8..00000000
--- a/mate-panel/panel-properties-dialog.ui
+++ /dev/null
@@ -1,767 +0,0 @@
-<?xml version="1.0"?>
-<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkDialog" id="panel_properties_dialog">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Panel Properties</property>
- <property name="resizable">False</property>
- <property name="window_position">center</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkNotebook" id="notebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">5</property>
- <child>
- <object class="GtkVBox" id="general_vbox">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkHBox" id="writability_warn_general">
- <child>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-dialog-warning</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Some of these properties are locked down</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="general_table">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkAlignment" id="icon_align">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xscale">0</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="icon_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">_Icon:</property>
- <property name="use_markup">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="size_widgets">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkSpinButton" id="size_spin">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">adjustment2</property>
- <property name="climb_rate">1</property>
- <property name="numeric">True</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="size_label_pixels">
- <property name="visible">True</property>
- <property name="label" translatable="yes">pixels</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="size_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Size:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">size_spin</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="orientation_combo">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="orientation_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Orientation:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">orientation_combo</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="expand_toggle">
- <property name="label" translatable="yes">E_xpand</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="autohide_toggle">
- <property name="label" translatable="yes">_Autohide</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="hidebuttons_toggle">
- <property name="label" translatable="yes">Show hide _buttons</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="no"> </property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="arrows_toggle">
- <property name="label" translatable="yes">Arro_ws on hide buttons</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</property>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkHBox" id="writability_warn_background">
- <child>
- <object class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="stock">gtk-dialog-warning</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Some of these properties are locked down</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="default_radio">
- <property name="label" translatable="yes">_None (use system theme)</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkRadioButton" id="color_radio">
- <property name="label" translatable="yes">Solid c_olor</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">default_radio</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="color_widgets">
- <property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> </property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table3">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="MateColorButton" id="color_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="title" translatable="yes">Pick a color</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="opacity_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">S_tyle:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">opacity_scale</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkHScale" id="opacity_scale">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
- <property name="draw_value">False</property>
- <accessibility>
- <relation type="labelled-by" target="opacity_label"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="color_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Co_lor:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">color_button</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="opacity_legend">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">&lt;small&gt;Transparent&lt;/small&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">&lt;small&gt;Opaque&lt;/small&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox6">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkRadioButton" id="image_radio">
- <property name="label" translatable="yes">Background _image:</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">default_radio</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="image_widgets">
- <property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> </property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkFileChooserButton" id="image_chooser">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select background</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Background</property>
- </object>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <child>
- <object class="GtkButton" id="helpbutton1">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="closebutton1">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-11">helpbutton1</action-widget>
- <action-widget response="-7">closebutton1</action-widget>
- </action-widgets>
- </object>
- <object class="GtkDialog" id="image_details_dialog">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Image Background Details</property>
- <property name="resizable">False</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="border_width">5</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkRadioButton" id="tile_radio">
- <property name="label" translatable="yes">_Tile</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="scale_radio">
- <property name="label" translatable="yes">_Scale</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">tile_radio</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="stretch_radio">
- <property name="label" translatable="yes">St_retch</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">tile_radio</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="rotate_toggle">
- <property name="label" translatable="yes">Rotate image when panel is _vertical</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <child>
- <object class="GtkButton" id="helpbutton2">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="closebutton2">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-11">helpbutton2</action-widget>
- <action-widget response="-7">closebutton2</action-widget>
- </action-widgets>
- </object>
- <object class="GtkAdjustment" id="adjustment1">
- <property name="value">33.75</property>
- <property name="upper">100</property>
- <property name="step_increment">5</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkAdjustment" id="adjustment2">
- <property name="value">12</property>
- <property name="lower">12</property>
- <property name="upper">120</property>
- <property name="step_increment">1</property>
- <property name="page_increment">12</property>
- </object>
-</interface>
diff --git a/mate-panel/panel-reset.c b/mate-panel/panel-reset.c
index 6670fc17..cdeba7ed 100644
--- a/mate-panel/panel-reset.c
+++ b/mate-panel/panel-reset.c
@@ -27,7 +27,7 @@
#define __PANEL_RESET_C__
#include <stdlib.h>
-#include <glib.h>
+#include <gio/gio.h>
#include "panel-reset.h"
#include "panel-schemas.h"
diff --git a/mate-panel/panel-reset.h b/mate-panel/panel-reset.h
index 125b6b3d..f9b6e33a 100644
--- a/mate-panel/panel-reset.h
+++ b/mate-panel/panel-reset.h
@@ -22,8 +22,6 @@
#ifndef __PANEL_RESET_H__
#define __PANEL_RESET_H__
-#include <gtk/gtk.h>
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
diff --git a/mate-panel/panel-run-dialog.c b/mate-panel/panel-run-dialog.c
index 61361dc1..769c5377 100644
--- a/mate-panel/panel-run-dialog.c
+++ b/mate-panel/panel-run-dialog.c
@@ -271,12 +271,7 @@ panel_run_dialog_set_icon (PanelRunDialog *dialog,
GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
GtkIconInfo *icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, size, 0);
pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
-#if GTK_CHECK_VERSION (3, 8, 0)
g_object_unref (icon_info);
-#else
- gtk_icon_info_free (icon_info);
-#endif
-
}
if (pixbuf) {
@@ -291,11 +286,7 @@ panel_run_dialog_set_icon (PanelRunDialog *dialog,
//(ditto for the drag icon?)
gtk_window_set_icon (GTK_WINDOW (dialog->run_dialog), pixbuf);
-#if GTK_CHECK_VERSION (3, 2, 0)
gtk_drag_source_set_icon_gicon (dialog->run_dialog, dialog->icon);
-#else
- gtk_drag_source_set_icon_pixbuf (dialog->run_dialog, pixbuf);
-#endif
g_object_unref (pixbuf);
} else {
panel_run_dialog_set_default_icon (dialog, TRUE);
@@ -436,8 +427,8 @@ panel_run_dialog_execute (PanelRunDialog *dialog)
}
/* evil eggies, do not translate! */
-#if !GTK_CHECK_VERSION (3, 0, 0)
/* FIXME re-add once GTK3 support is fixed */
+#if 0
if (!strcmp (command, "free the fish")) {
start_screen_check ();
@@ -1833,14 +1824,8 @@ pixmap_drag_data_get (GtkWidget *run_dialog,
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_run_dialog_style_updated (GtkWidget *widget,
PanelRunDialog *dialog)
-#else
-panel_run_dialog_style_set (GtkWidget *widget,
- GtkStyle *prev_style,
- PanelRunDialog *dialog)
-#endif
{
if (dialog->icon) {
GIcon *icon;
@@ -1871,15 +1856,9 @@ panel_run_dialog_setup_pixmap (PanelRunDialog *dialog,
{
dialog->pixmap = PANEL_GTK_BUILDER_GET (gui, "icon_pixmap");
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect (dialog->pixmap, "style-updated",
G_CALLBACK (panel_run_dialog_style_updated),
dialog);
-#else
- g_signal_connect (dialog->pixmap, "style-set",
- G_CALLBACK (panel_run_dialog_style_set),
- dialog);
-#endif
g_signal_connect (dialog->pixmap, "screen-changed",
G_CALLBACK (panel_run_dialog_screen_changed),
dialog);
@@ -1940,15 +1919,9 @@ panel_run_dialog_new (GdkScreen *screen,
static void
panel_run_dialog_disconnect_pixmap (PanelRunDialog *dialog)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_handlers_disconnect_by_func (dialog->pixmap,
G_CALLBACK (panel_run_dialog_style_updated),
dialog);
-#else
- g_signal_handlers_disconnect_by_func (dialog->pixmap,
- G_CALLBACK (panel_run_dialog_style_set),
- dialog);
-#endif
g_signal_handlers_disconnect_by_func (dialog->pixmap,
G_CALLBACK (panel_run_dialog_screen_changed),
dialog);
diff --git a/mate-panel/panel-run-dialog.h b/mate-panel/panel-run-dialog.h
index 5e491d5a..49adc49c 100644
--- a/mate-panel/panel-run-dialog.h
+++ b/mate-panel/panel-run-dialog.h
@@ -25,7 +25,7 @@
#ifndef __PANEL_RUN_DIALOG_H__
#define __PANEL_RUN_DIALOG_H__
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
G_BEGIN_DECLS
diff --git a/mate-panel/panel-separator.c b/mate-panel/panel-separator.c
index 33a56768..5982196a 100644
--- a/mate-panel/panel-separator.c
+++ b/mate-panel/panel-separator.c
@@ -41,7 +41,6 @@ struct _PanelSeparatorPrivate {
G_DEFINE_TYPE (PanelSeparator, panel_separator, GTK_TYPE_EVENT_BOX)
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean
panel_separator_draw (GtkWidget *widget, cairo_t *cr)
{
@@ -97,50 +96,6 @@ panel_separator_draw (GtkWidget *widget, cairo_t *cr)
return FALSE;
}
-#else
-
-static gboolean
-panel_separator_expose_event (GtkWidget *widget, GdkEventExpose *event)
-{
- PanelSeparator *separator;
- GtkStyle *style;
- GdkWindow *window;
- GtkAllocation allocation;
-
- separator = PANEL_SEPARATOR (widget);
-
- if (!gtk_widget_is_drawable(widget))
- return FALSE;
-
- GTK_WIDGET_CLASS(panel_separator_parent_class)->expose_event(widget, event);
-
- style = gtk_widget_get_style (widget);
- window = gtk_widget_get_window (widget);
- gtk_widget_get_allocation (widget, &allocation);
-
- if (separator->priv->orientation == GTK_ORIENTATION_HORIZONTAL) {
- gtk_paint_vline (style,
- window,
- gtk_widget_get_state (widget),
- &event->area, widget, "separator",
- style->xthickness,
- allocation.height - style->xthickness,
- (allocation.width - style->xthickness) / 2);
- } else {
- gtk_paint_hline (style,
- window,
- gtk_widget_get_state (widget),
- &event->area, widget, "separator",
- style->ythickness,
- allocation.width - style->ythickness,
- (allocation.height - style->ythickness) / 2);
- }
-
- return FALSE;
-}
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
panel_separator_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
@@ -176,27 +131,6 @@ panel_separator_get_preferred_height (GtkWidget *widget,
else
*minimal_height = *natural_height = size;
}
-#else
-static void
-panel_separator_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- PanelSeparator *separator;
- int size;
-
- separator = PANEL_SEPARATOR (widget);
-
- size = panel_toplevel_get_size (separator->priv->panel->toplevel);
-
- if (separator->priv->orientation == GTK_ORIENTATION_VERTICAL) {
- requisition->width = size;
- requisition->height = SEPARATOR_SIZE;
- } else {
- requisition->width = SEPARATOR_SIZE;
- requisition->height = size;
- }
-}
-#endif
static void
panel_separator_size_allocate (GtkWidget *widget,
@@ -252,14 +186,9 @@ panel_separator_class_init (PanelSeparatorClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->draw = panel_separator_draw;
widget_class->get_preferred_width = panel_separator_get_preferred_width;
widget_class->get_preferred_height = panel_separator_get_preferred_height;
-#else
- widget_class->expose_event = panel_separator_expose_event;
- widget_class->size_request = panel_separator_size_request;
-#endif
widget_class->size_allocate = panel_separator_size_allocate;
widget_class->parent_set = panel_separator_parent_set;
@@ -352,9 +281,7 @@ panel_separator_change_background (PanelSeparator *separator)
{
#if GTK_CHECK_VERSION (3, 18, 0)
panel_background_apply_css(&separator->priv->panel->toplevel->background, GTK_WIDGET(separator));
-#elif GTK_CHECK_VERSION (3, 0, 0)
- panel_background_apply_css(&separator->priv->panel->background, GTK_WIDGET(separator));
#else
- panel_background_change_background_on_widget(&separator->priv->panel->background, GTK_WIDGET(separator));
+ panel_background_apply_css(&separator->priv->panel->background, GTK_WIDGET(separator));
#endif
}
diff --git a/mate-panel/panel-session.c b/mate-panel/panel-session.c
index 6377c4ac..109500e1 100644
--- a/mate-panel/panel-session.c
+++ b/mate-panel/panel-session.c
@@ -23,17 +23,11 @@
*/
#include <config.h>
-
#include <stdlib.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
#include <gdk/gdkx.h>
-
#include <libegg/eggsmclient.h>
#include "panel-shell.h"
-
#include "panel-session.h"
static gboolean do_not_restart = FALSE;
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c
index b3a886a6..5fa785b3 100644
--- a/mate-panel/panel-toplevel.c
+++ b/mate-panel/panel-toplevel.c
@@ -146,11 +146,7 @@ struct _PanelToplevelPrivate {
PanelWidget *panel_widget;
PanelFrame *inner_frame;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *grid;
-#else
- GtkWidget *table;
-#endif
GtkWidget *hide_button_top;
GtkWidget *hide_button_bottom;
GtkWidget *hide_button_left;
@@ -442,7 +438,6 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp
GdkWindow *window;
GdkCursorType cursor_type;
GdkCursor *cursor;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
#if GTK_CHECK_VERSION (3, 20, 0)
GdkSeat *seat;
@@ -452,7 +447,6 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp
GdkDevice *keyboard;
GdkDeviceManager *device_manager;
#endif
-#endif
if (toplevel->priv->state != PANEL_STATE_NORMAL ||
toplevel->priv->grab_op != PANEL_GRAB_OP_NONE)
@@ -508,7 +502,6 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp
cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
cursor_type);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_window_get_display (window);
#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat (display);
@@ -520,7 +513,6 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp
NULL, NULL, NULL);
g_object_unref (cursor);
-}
#else
device_manager = gdk_display_get_device_manager (display);
pointer = gdk_device_manager_get_client_pointer (device_manager);
@@ -538,24 +530,12 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp
GDK_OWNERSHIP_NONE, FALSE,
GDK_KEY_PRESS | GDK_KEY_RELEASE,
NULL, time_);
-}
#endif
-#else
- gdk_pointer_grab (window, FALSE,
- GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
- NULL, cursor, time_);
-
- gdk_cursor_unref (cursor);
-
- if (grab_keyboard)
- gdk_keyboard_grab (window, FALSE, time_);
}
-#endif
static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_)
{
GtkWidget *widget;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
#if GTK_CHECK_VERSION (3, 20, 0)
GdkSeat *seat;
@@ -564,8 +544,6 @@ static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_)
GdkDevice *keyboard;
GdkDeviceManager *device_manager;
#endif
-#endif
-
g_return_if_fail (toplevel->priv->grab_op != PANEL_GRAB_OP_NONE);
widget = GTK_WIDGET (toplevel);
@@ -575,7 +553,6 @@ static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_)
gtk_grab_remove (widget);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gtk_widget_get_display (widget);
#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat (display);
@@ -589,10 +566,6 @@ static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_)
gdk_device_ungrab (pointer, time_);
gdk_device_ungrab (keyboard, time_);
#endif
-#else
- gdk_pointer_ungrab (time_);
- gdk_keyboard_ungrab (time_);
-#endif
}
static void panel_toplevel_cancel_grab_op(PanelToplevel* toplevel, guint32 time_)
@@ -891,9 +864,7 @@ static gboolean panel_toplevel_warp_pointer_increment(PanelToplevel* toplevel, i
{
GdkScreen *screen;
GdkWindow *root_window;
-#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *device;
-#endif
int new_x, new_y;
screen = gtk_window_get_screen (GTK_WINDOW (toplevel));
@@ -901,11 +872,9 @@ static gboolean panel_toplevel_warp_pointer_increment(PanelToplevel* toplevel, i
#if GTK_CHECK_VERSION(3, 20, 0)
device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET(root_window))));
gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET (root_window)), device, &new_x, &new_y, NULL);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET(root_window))));
gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET (root_window)), device, &new_x, &new_y, NULL);
-#else
- gdk_window_get_pointer (root_window, &new_x, &new_y, NULL);
#endif
switch (keyval) {
@@ -1211,7 +1180,6 @@ static void panel_toplevel_hide_button_clicked(PanelToplevel* toplevel, GtkButto
panel_toplevel_unhide (toplevel);
}
-#if GTK_CHECK_VERSION(3, 14, 0)
static void
set_arrow_type (GtkImage *image,
GtkArrowType arrow_type)
@@ -1233,20 +1201,12 @@ set_arrow_type (GtkImage *image,
break;
}
}
-#endif
static GtkWidget *
panel_toplevel_add_hide_button (PanelToplevel *toplevel,
GtkArrowType arrow_type,
-#if GTK_CHECK_VERSION (3, 0, 0)
int left,
int top)
-#else
- int left_attach,
- int right_attach,
- int top_attach,
- int bottom_attach)
-#endif
{
GtkWidget *button;
AtkObject *obj;
@@ -1280,18 +1240,10 @@ panel_toplevel_add_hide_button (PanelToplevel *toplevel,
break;
}
-#if GTK_CHECK_VERSION(3, 14, 0)
arrow = gtk_image_new ();
set_arrow_type (GTK_IMAGE (arrow), arrow_type);
-#else
- arrow = gtk_arrow_new (arrow_type, GTK_SHADOW_NONE);
-#endif
-#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(GTK_WIDGET(arrow), 0);
gtk_widget_set_margin_end(GTK_WIDGET(arrow), 0);
-#else
- gtk_misc_set_padding (GTK_MISC (arrow), 0, 0);
-#endif
gtk_container_add (GTK_CONTAINER (button), arrow);
gtk_widget_show (arrow);
@@ -1306,20 +1258,7 @@ panel_toplevel_add_hide_button (PanelToplevel *toplevel,
g_signal_connect_swapped (button, "button_release_event",
G_CALLBACK (panel_toplevel_hide_button_event), toplevel);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (toplevel->priv->grid), button, left, top, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (toplevel->priv->table),
- button,
- left_attach,
- right_attach,
- top_attach,
- bottom_attach,
- GTK_FILL,
- GTK_FILL,
- 0,
- 0);
-#endif
return button;
}
@@ -1423,7 +1362,7 @@ static gboolean panel_toplevel_contains_pointer(PanelToplevel* toplevel)
#if GTK_CHECK_VERSION(3, 20, 0)
GdkSeat *seat;
GdkDevice *pointer;
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
GdkDeviceManager *device_manager;
GdkDevice *pointer;
#endif
@@ -1433,7 +1372,7 @@ static gboolean panel_toplevel_contains_pointer(PanelToplevel* toplevel)
#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat (display);
pointer = gdk_seat_get_pointer (seat);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
device_manager = gdk_display_get_device_manager (display);
pointer = gdk_device_manager_get_client_pointer (device_manager);
#endif
@@ -1444,11 +1383,7 @@ static gboolean panel_toplevel_contains_pointer(PanelToplevel* toplevel)
screen = NULL;
x = y = -1;
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_device_get_position (pointer, &screen, &x, &y);
-#else
- gdk_display_get_pointer (display, &screen, &x, &y, NULL);
-#endif
if (screen != gtk_window_get_screen (GTK_WINDOW (toplevel)))
return FALSE;
@@ -1604,9 +1539,6 @@ void panel_toplevel_update_edges(PanelToplevel* toplevel)
PanelFrameEdge edges;
PanelFrameEdge inner_edges;
PanelFrameEdge outer_edges;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- PanelBackground *background;
-#endif
int monitor_width, monitor_height;
int width, height;
gboolean inner_frame = FALSE;
@@ -1620,55 +1552,46 @@ void panel_toplevel_update_edges(PanelToplevel* toplevel)
height = toplevel->priv->geometry.height;
edges = PANEL_EDGE_NONE;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- background = &toplevel->priv->panel_widget->background;
-#endif
/* We don't want any bevels with a color/image background */
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (panel_background_effective_type (background) == PANEL_BACK_NONE) {
-#endif
- if (toplevel->priv->geometry.y > 0)
- edges |= PANEL_EDGE_TOP;
-
- if (toplevel->priv->geometry.x > 0)
- edges |= PANEL_EDGE_LEFT;
-
- if (toplevel->priv->geometry.y < (monitor_height - height))
- edges |= PANEL_EDGE_BOTTOM;
-
- if (toplevel->priv->geometry.x < (monitor_width - width))
- edges |= PANEL_EDGE_RIGHT;
-
- /* There is a conflict in the position algorithm when a
- * non-expanded centered panel is nearly the size of the
- * screen. This is similar to the one we have in
- * panel_toplevel_update_position(). A simple solution is
- * to keep the bevels in this case. */
- if (!toplevel->priv->expand &&
- toplevel->priv->orientation & PANEL_HORIZONTAL_MASK &&
- toplevel->priv->x_centered)
- edges |= PANEL_EDGE_LEFT | PANEL_EDGE_RIGHT;
-
- if (!toplevel->priv->expand &&
- toplevel->priv->orientation & PANEL_VERTICAL_MASK &&
- toplevel->priv->y_centered)
- edges |= PANEL_EDGE_TOP | PANEL_EDGE_BOTTOM;
-
- if (gtk_widget_get_visible (toplevel->priv->hide_button_left) ||
- gtk_widget_get_visible (toplevel->priv->hide_button_right)) {
- inner_frame = TRUE;
- edges |= PANEL_EDGE_LEFT | PANEL_EDGE_RIGHT;
- }
+ if (toplevel->priv->geometry.y > 0)
+ edges |= PANEL_EDGE_TOP;
- if (gtk_widget_get_visible (toplevel->priv->hide_button_top) ||
- gtk_widget_get_visible (toplevel->priv->hide_button_bottom)) {
- inner_frame = TRUE;
- edges |= PANEL_EDGE_TOP | PANEL_EDGE_BOTTOM;
- }
-#if !GTK_CHECK_VERSION(3, 0, 0)
+ if (toplevel->priv->geometry.x > 0)
+ edges |= PANEL_EDGE_LEFT;
+
+ if (toplevel->priv->geometry.y < (monitor_height - height))
+ edges |= PANEL_EDGE_BOTTOM;
+
+ if (toplevel->priv->geometry.x < (monitor_width - width))
+ edges |= PANEL_EDGE_RIGHT;
+
+ /* There is a conflict in the position algorithm when a
+ * non-expanded centered panel is nearly the size of the
+ * screen. This is similar to the one we have in
+ * panel_toplevel_update_position(). A simple solution is
+ * to keep the bevels in this case. */
+ if (!toplevel->priv->expand &&
+ toplevel->priv->orientation & PANEL_HORIZONTAL_MASK &&
+ toplevel->priv->x_centered)
+ edges |= PANEL_EDGE_LEFT | PANEL_EDGE_RIGHT;
+
+ if (!toplevel->priv->expand &&
+ toplevel->priv->orientation & PANEL_VERTICAL_MASK &&
+ toplevel->priv->y_centered)
+ edges |= PANEL_EDGE_TOP | PANEL_EDGE_BOTTOM;
+
+ if (gtk_widget_get_visible (toplevel->priv->hide_button_left) ||
+ gtk_widget_get_visible (toplevel->priv->hide_button_right)) {
+ inner_frame = TRUE;
+ edges |= PANEL_EDGE_LEFT | PANEL_EDGE_RIGHT;
+ }
+
+ if (gtk_widget_get_visible (toplevel->priv->hide_button_top) ||
+ gtk_widget_get_visible (toplevel->priv->hide_button_bottom)) {
+ inner_frame = TRUE;
+ edges |= PANEL_EDGE_TOP | PANEL_EDGE_BOTTOM;
}
-#endif
if (!inner_frame) {
inner_edges = PANEL_EDGE_NONE;
@@ -2360,7 +2283,6 @@ panel_toplevel_update_position (PanelToplevel *toplevel)
#endif
/* There's no bevels with a color/image background */
if (panel_background_effective_type (background) == PANEL_BACK_NONE) {
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkStateFlags state;
GdkRectangle *geometry;
@@ -2389,34 +2311,7 @@ panel_toplevel_update_position (PanelToplevel *toplevel)
if (y + padding.top >= max_size && y < max_size &&
!toplevel->priv->y_centered)
y = max_size;
- }
-#else
- GtkStyle *style;
- GdkRectangle *geometry;
- int max_size;
-
- style = gtk_widget_get_style (GTK_WIDGET (toplevel->priv->inner_frame));
- geometry = &toplevel->priv->geometry;
-
- if (x <= style->xthickness && x > 0 &&
- !toplevel->priv->x_centered)
- x = 0;
-
- if (y <= style->ythickness && y > 0 &&
- !toplevel->priv->y_centered)
- y = 0;
-
- max_size = monitor_width - geometry->width - style->xthickness;
- if (x + style->xthickness >= max_size && x < max_size &&
- !toplevel->priv->x_centered)
- x = max_size;
-
- max_size = monitor_height - geometry->height - style->ythickness;
- if (y + style->ythickness >= max_size && y < max_size &&
- !toplevel->priv->y_centered)
- y = max_size;
}
-#endif
x += panel_multiscreen_x (screen, toplevel->priv->monitor);
y += panel_multiscreen_y (screen, toplevel->priv->monitor);
@@ -2429,14 +2324,10 @@ static int
calculate_minimum_height (GtkWidget *widget,
PanelOrientation orientation)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStateFlags state;
GtkStyleContext *style_context;
const PangoFontDescription *font_desc;
GtkBorder padding;
-#else
- GtkStyle *style;
-#endif
PangoContext *pango_context;
PangoFontMetrics *metrics;
#if !GTK_CHECK_VERSION (3, 20, 0)
@@ -2447,7 +2338,6 @@ calculate_minimum_height (GtkWidget *widget,
int descent;
int thickness;
-#if GTK_CHECK_VERSION (3, 0, 0)
state = gtk_widget_get_state_flags (widget);
style_context = gtk_widget_get_style_context (widget);
gtk_style_context_get(style_context, state, GTK_STYLE_PROPERTY_FONT, &font_desc, NULL);
@@ -2457,14 +2347,7 @@ calculate_minimum_height (GtkWidget *widget,
font_desc,
pango_context_get_language (pango_context));
gtk_style_context_get_padding (style_context, state, &padding);
-#else
- style = gtk_widget_get_style (widget);
- pango_context = gtk_widget_get_pango_context (widget);
- metrics = pango_context_get_metrics (pango_context,
- style->font_desc,
- pango_context_get_language (pango_context));
-#endif
ascent = pango_font_metrics_get_ascent (metrics);
descent = pango_font_metrics_get_descent (metrics);
@@ -2477,7 +2360,6 @@ calculate_minimum_height (GtkWidget *widget,
NULL);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
thickness = orientation & PANEL_HORIZONTAL_MASK ?
padding.top + padding.bottom :
padding.left + padding.right;
@@ -2488,14 +2370,6 @@ calculate_minimum_height (GtkWidget *widget,
return PANGO_PIXELS (ascent + descent) + 2 * (focus_width + focus_pad) + thickness;
#endif
}
-#else
- thickness = orientation & PANEL_HORIZONTAL_MASK ?
- style->ythickness :
- style->xthickness;
-
- return PANGO_PIXELS (ascent + descent) + 2 * (focus_width + focus_pad + thickness);
-}
-#endif
static int
panel_toplevel_update_size_from_hints (PanelToplevel *toplevel,
@@ -2589,13 +2463,9 @@ panel_toplevel_update_size (PanelToplevel *toplevel,
GtkRequisition *requisition)
{
GtkWidget *widget;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
-#else
- GtkStyle *style;
-#endif
int monitor_width, monitor_height;
int width, height;
int minimum_height;
@@ -2605,13 +2475,9 @@ panel_toplevel_update_size (PanelToplevel *toplevel,
return;
widget = GTK_WIDGET (toplevel);
-#if GTK_CHECK_VERSION (3, 0, 0)
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_style_context_get_padding (context, state, &padding);
-#else
- style = gtk_widget_get_style (widget);
-#endif
panel_toplevel_get_monitor_geometry (
toplevel, NULL, NULL, &monitor_width, &monitor_height);
@@ -2689,7 +2555,6 @@ panel_toplevel_update_size (PanelToplevel *toplevel,
height = MAX (MINIMUM_WIDTH, height);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
if (toplevel->priv->edges & PANEL_EDGE_TOP)
height += padding.top;
if (toplevel->priv->edges & PANEL_EDGE_BOTTOM)
@@ -2698,16 +2563,6 @@ panel_toplevel_update_size (PanelToplevel *toplevel,
width += padding.left;
if (toplevel->priv->edges & PANEL_EDGE_RIGHT)
width += padding.right;
-#else
- if (toplevel->priv->edges & PANEL_EDGE_TOP)
- height += style->ythickness;
- if (toplevel->priv->edges & PANEL_EDGE_BOTTOM)
- height += style->ythickness;
- if (toplevel->priv->edges & PANEL_EDGE_LEFT)
- width += style->ythickness;
- if (toplevel->priv->edges & PANEL_EDGE_RIGHT)
- width += style->ythickness;
-#endif
toplevel->priv->geometry.width = CLAMP (width, 0, monitor_width);
toplevel->priv->geometry.height = CLAMP (height, 0, monitor_height);
@@ -2856,11 +2711,7 @@ panel_toplevel_reverse_arrow (PanelToplevel *toplevel,
g_object_set_data (G_OBJECT (button), "arrow-type", GINT_TO_POINTER (arrow_type));
-#if GTK_CHECK_VERSION(3, 14, 0)
set_arrow_type (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))), arrow_type);
-#else
- gtk_arrow_set (GTK_ARROW (gtk_bin_get_child (GTK_BIN (button))), arrow_type, GTK_SHADOW_NONE);
-#endif
}
static void
@@ -3292,11 +3143,7 @@ panel_toplevel_check_resize (GtkContainer *container)
requisition.width = -1;
requisition.height = -1;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (widget, &requisition, NULL);
-#else
- gtk_widget_size_request (widget, &requisition);
-#endif
gtk_widget_get_allocation (widget, &allocation);
allocation.width = requisition.width;
@@ -3325,11 +3172,7 @@ panel_toplevel_size_request (GtkWidget *widget,
child = gtk_bin_get_child (bin);
if (child && gtk_widget_get_visible (child))
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (child, requisition, NULL);
-#else
- gtk_widget_size_request (child, requisition);
-#endif
old_geometry = toplevel->priv->geometry;
@@ -3352,7 +3195,6 @@ panel_toplevel_size_request (GtkWidget *widget,
panel_toplevel_move_resize_window (toplevel, position_changed, size_changed);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
panel_toplevel_get_preferred_width (GtkWidget *widget,
gint *minimum_width,
@@ -3372,7 +3214,6 @@ panel_toplevel_get_preferred_height (GtkWidget *widget,
panel_toplevel_size_request (widget, &req);
*minimum_height = *natural_height = req.height;
}
-#endif
#if GTK_CHECK_VERSION (3, 18, 0)
static void
@@ -3413,13 +3254,9 @@ panel_toplevel_size_allocate (GtkWidget *widget,
{
PanelToplevel *toplevel = (PanelToplevel *) widget;
GtkBin *bin = (GtkBin *) widget;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
-#else
- GtkStyle *style;
-#endif
GtkWidget *child;
GtkAllocation challoc;
GtkAllocation child_allocation;
@@ -3444,7 +3281,6 @@ panel_toplevel_size_allocate (GtkWidget *widget,
}
}
-#if GTK_CHECK_VERSION (3, 0, 0)
state = gtk_widget_get_state_flags (widget);
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_padding (context, state, &padding);
@@ -3464,25 +3300,6 @@ panel_toplevel_size_allocate (GtkWidget *widget,
if (toplevel->priv->edges & PANEL_EDGE_RIGHT)
challoc.width -= padding.right;
-#else
- style = gtk_widget_get_style (widget);
-
- if (toplevel->priv->edges & PANEL_EDGE_TOP) {
- challoc.y += style->ythickness;
- challoc.height -= style->ythickness;
- }
-
- if (toplevel->priv->edges & PANEL_EDGE_LEFT) {
- challoc.x += style->xthickness;
- challoc.width -= style->xthickness;
- }
-
- if (toplevel->priv->edges & PANEL_EDGE_BOTTOM)
- challoc.height -= style->ythickness;
-
- if (toplevel->priv->edges & PANEL_EDGE_RIGHT)
- challoc.width -= style->xthickness;
-#endif
challoc.width = MAX (1, challoc.width);
challoc.height = MAX (1, challoc.height);
@@ -3509,52 +3326,31 @@ panel_toplevel_size_allocate (GtkWidget *widget,
#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static gboolean panel_toplevel_draw(GtkWidget* widget, cairo_t* cr)
-#else
-static gboolean panel_toplevel_expose(GtkWidget* widget, GdkEventExpose* event)
-#endif
{
PanelToplevel* toplevel = (PanelToplevel*) widget;
PanelFrameEdge edges;
gboolean retval = FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
int awidth;
int aheight;
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
-#else
- GdkWindow *window;
- GtkStyle *style;
- GtkStateType state;
- GtkAllocation allocation;
-#endif
if (!gtk_widget_is_drawable (widget))
return retval;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (GTK_WIDGET_CLASS (panel_toplevel_parent_class)->draw)
retval = GTK_WIDGET_CLASS (panel_toplevel_parent_class)->draw (widget, cr);
-#else
- if (GTK_WIDGET_CLASS (panel_toplevel_parent_class)->expose_event)
- retval = GTK_WIDGET_CLASS (panel_toplevel_parent_class)->expose_event (widget, event);
-#endif
edges = toplevel->priv->edges;
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_frame_draw (widget, cr, edges);
-#else
- panel_frame_draw (widget, edges);
-#endif
if (toplevel->priv->expand ||
toplevel->priv->buttons_enabled ||
toplevel->priv->attached)
return retval;
-#if GTK_CHECK_VERSION (3, 0, 0)
state = gtk_widget_get_state_flags (widget);
awidth = gtk_widget_get_allocated_width (widget);
aheight = gtk_widget_get_allocated_height (widget);
@@ -3564,185 +3360,66 @@ static gboolean panel_toplevel_expose(GtkWidget* widget, GdkEventExpose* event)
gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
-#else
- window = gtk_widget_get_window (widget);
- style = gtk_widget_get_style (widget);
- state = gtk_widget_get_state (widget);
- gtk_widget_get_allocation (widget, &allocation);
-#endif
if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK) {
int x, y, width, height;
-#if GTK_CHECK_VERSION (3, 0, 0)
x = 0;
y = 0;
height = aheight;
-#else
- int xthickness, ythickness;
- x = allocation.x;
- y = allocation.y;
- height = allocation.height;
-#endif
width = HANDLE_SIZE;
-#if !GTK_CHECK_VERSION(3, 0, 0)
- xthickness = style->xthickness;
- ythickness = style->ythickness;
-#endif
-
if (edges & PANEL_EDGE_TOP) {
-#if GTK_CHECK_VERSION (3, 0, 0)
y += padding.top;
height -= padding.top;
-#else
- y += ythickness;
- height -= ythickness;
-#endif
}
if (edges & PANEL_EDGE_BOTTOM)
-#if GTK_CHECK_VERSION (3, 0, 0)
height -= padding.bottom;
-#else
- height -= ythickness;
-#endif
if (edges & PANEL_EDGE_LEFT)
-#if GTK_CHECK_VERSION (3, 0, 0)
x += padding.left;
-#else
- x += xthickness;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_save (cr);
gtk_render_handle (context, cr, x, y, width, height);
cairo_restore (cr);
-#else
- gtk_paint_handle (style,
- window,
- state,
- GTK_SHADOW_OUT,
- &event->area,
- widget, "handlebox",
- x, y, width, height,
- GTK_ORIENTATION_VERTICAL);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
x = awidth - HANDLE_SIZE;
-#else
- x = allocation.width - HANDLE_SIZE;
-#endif
if (edges & PANEL_EDGE_RIGHT)
-#if GTK_CHECK_VERSION (3, 0, 0)
x -= padding.right;
-#else
- x -= xthickness;
-#endif
-#if GTK_CHECK_VERSION(3, 0, 0)
cairo_save (cr);
gtk_render_handle (context, cr, x, y, width, height);
cairo_restore (cr);
-#else
- gtk_paint_handle (style,
- window,
- state,
- GTK_SHADOW_OUT,
- &event->area,
- widget, "handlebox",
- x, y, width, height,
- GTK_ORIENTATION_VERTICAL);
-#endif
} else {
int x, y, width, height;
-#if GTK_CHECK_VERSION (3, 0, 0)
x = 0;
y = 0;
width = awidth;
-#else
- int xthickness, ythickness;
-
- x = allocation.x;
- y = allocation.y;
- width = allocation.width;
-#endif
height = HANDLE_SIZE;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- xthickness = style->xthickness;
- ythickness = style->ythickness;
-#endif
-
if (edges & PANEL_EDGE_LEFT) {
-#if GTK_CHECK_VERSION (3, 0, 0)
x += padding.left;
width -= padding.left;
-#else
- x += xthickness;
- width -= xthickness;
-#endif
}
if (edges & PANEL_EDGE_RIGHT)
-#if GTK_CHECK_VERSION (3, 0, 0)
width -= padding.right;
-#else
- width -= xthickness;
-#endif
if (edges & PANEL_EDGE_TOP)
-#if GTK_CHECK_VERSION (3, 0, 0)
y += padding.top;
-#else
- y += ythickness;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_save (cr);
gtk_render_handle (context, cr, x, y, width, height);
cairo_restore (cr);
-#else
- gtk_paint_handle (style,
- window,
- state,
- GTK_SHADOW_OUT,
- &event->area,
- widget, "handlebox",
- x, y, width, height,
- GTK_ORIENTATION_HORIZONTAL);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
y = aheight - HANDLE_SIZE;
-#else
- y = allocation.height - HANDLE_SIZE;
-#endif
if (edges & PANEL_EDGE_BOTTOM)
-#if GTK_CHECK_VERSION (3, 0, 0)
y -= padding.bottom;
-#else
- y -= ythickness;
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_save (cr);
gtk_render_handle (context, cr, x, y, width, height);
cairo_restore (cr);
-#else
- gtk_paint_handle (style,
- window,
- state,
- GTK_SHADOW_OUT,
- &event->area,
- widget, "handlebox",
- x, y, width, height,
- GTK_ORIENTATION_HORIZONTAL);
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_style_context_restore (context);
-#endif
return retval;
}
@@ -3998,11 +3675,7 @@ panel_toplevel_start_animation (PanelToplevel *toplevel)
deltax = toplevel->priv->animation_end_x - cur_x;
deltay = toplevel->priv->animation_end_y - cur_y;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (GTK_WIDGET (toplevel), &requisition, NULL);
-#else
- gtk_widget_get_requisition (GTK_WIDGET (toplevel), &requisition);
-#endif
if (toplevel->priv->animation_end_width != -1)
deltaw = toplevel->priv->animation_end_width - requisition.width;
@@ -4332,7 +4005,6 @@ panel_toplevel_focus_out_event (GtkWidget *widget,
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_toplevel_style_updated (GtkWidget *widget)
{
panel_toplevel_update_hide_buttons (PANEL_TOPLEVEL (widget));
@@ -4344,17 +4016,6 @@ panel_toplevel_style_updated (GtkWidget *widget)
set_background_default_style (widget);
#endif
}
-#else
-panel_toplevel_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-
-{
- panel_toplevel_update_hide_buttons (PANEL_TOPLEVEL (widget));
-
- if (GTK_WIDGET_CLASS (panel_toplevel_parent_class)->style_set)
- GTK_WIDGET_CLASS (panel_toplevel_parent_class)->style_set (widget, previous_style);
-}
-#endif
static void
panel_toplevel_drag_threshold_changed (PanelToplevel *toplevel)
@@ -4586,12 +4247,10 @@ panel_toplevel_constructor (GType type,
object = G_OBJECT_CLASS (panel_toplevel_parent_class)->constructor (type,
n_construct_properties,
construct_properties);
-#if GTK_CHECK_VERSION (3, 0, 0)
PanelToplevel *toplevel = PANEL_TOPLEVEL(object);
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
gtk_widget_set_visual(GTK_WIDGET(toplevel), visual);
-#endif
return object;
}
@@ -4672,23 +4331,16 @@ panel_toplevel_class_init (PanelToplevelClass *klass)
#if GTK_CHECK_VERSION (3, 18, 0)
widget_class->state_flags_changed = panel_toplevel_state_flags_changed;
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->draw = panel_toplevel_draw;
widget_class->get_preferred_width = panel_toplevel_get_preferred_width;
widget_class->get_preferred_height = panel_toplevel_get_preferred_height;
widget_class->style_updated = panel_toplevel_style_updated;
-#else
- widget_class->expose_event = panel_toplevel_expose;
- widget_class->size_request = panel_toplevel_size_request;
- widget_class->style_set = panel_toplevel_style_set;
-#endif
widget_class->size_allocate = panel_toplevel_size_allocate;
widget_class->button_press_event = panel_toplevel_button_press_event;
widget_class->button_release_event = panel_toplevel_button_release_event;
#if GTK_CHECK_VERSION (3, 18, 0)
widget_class->configure_event = panel_toplevel_configure_event;
#endif
-
widget_class->key_press_event = panel_toplevel_key_press_event;
widget_class->motion_notify_event = panel_toplevel_motion_notify_event;
widget_class->enter_notify_event = panel_toplevel_enter_notify_event;
@@ -5057,24 +4709,12 @@ panel_toplevel_setup_widgets (PanelToplevel *toplevel)
{
GtkWidget* container;
-#if GTK_CHECK_VERSION (3, 0, 0)
toplevel->priv->grid = gtk_grid_new ();
toplevel->priv->hide_button_top = panel_toplevel_add_hide_button (toplevel, GTK_ARROW_UP, 1, 0);
toplevel->priv->hide_button_bottom = panel_toplevel_add_hide_button (toplevel, GTK_ARROW_DOWN, 1, 2);
toplevel->priv->hide_button_left = panel_toplevel_add_hide_button (toplevel, GTK_ARROW_LEFT, 0, 1);
toplevel->priv->hide_button_right = panel_toplevel_add_hide_button (toplevel, GTK_ARROW_RIGHT, 2, 1);
-#else
- toplevel->priv->table = gtk_table_new(3, 3, FALSE);
-
- toplevel->priv->hide_button_top = panel_toplevel_add_hide_button(toplevel, GTK_ARROW_UP, 1, 2, 0, 1);
-
- toplevel->priv->hide_button_bottom = panel_toplevel_add_hide_button(toplevel, GTK_ARROW_DOWN, 1, 2, 2, 3);
-
- toplevel->priv->hide_button_left = panel_toplevel_add_hide_button(toplevel, GTK_ARROW_LEFT, 0, 1, 1, 2);
-
- toplevel->priv->hide_button_right = panel_toplevel_add_hide_button(toplevel, GTK_ARROW_RIGHT, 2, 3, 1, 2);
-#endif
if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK)
{
@@ -5089,20 +4729,10 @@ panel_toplevel_setup_widgets (PanelToplevel *toplevel)
toplevel->priv->inner_frame = g_object_new(PANEL_TYPE_FRAME, NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_hexpand (GTK_WIDGET (toplevel->priv->inner_frame), TRUE);
gtk_widget_set_vexpand (GTK_WIDGET (toplevel->priv->inner_frame), TRUE);
gtk_grid_attach (GTK_GRID (toplevel->priv->grid), GTK_WIDGET (toplevel->priv->inner_frame), 1, 1, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (toplevel->priv->table),
- GTK_WIDGET (toplevel->priv->inner_frame),
- 1, 2,
- 1, 2,
- GTK_FILL | GTK_EXPAND | GTK_SHRINK,
- GTK_FILL | GTK_EXPAND | GTK_SHRINK,
- 0, 0);
-#endif
gtk_widget_show (GTK_WIDGET (toplevel->priv->inner_frame));
container = panel_widget_new (toplevel,
@@ -5117,13 +4747,8 @@ panel_toplevel_setup_widgets (PanelToplevel *toplevel)
gtk_container_add(GTK_CONTAINER(toplevel->priv->inner_frame), container);
gtk_widget_show(container);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (toplevel), toplevel->priv->grid);
gtk_widget_show (toplevel->priv->grid);
-#else
- gtk_container_add(GTK_CONTAINER(toplevel), toplevel->priv->table);
- gtk_widget_show(toplevel->priv->table);
-#endif
}
#if GTK_CHECK_VERSION (3, 18, 0)
@@ -5134,8 +4759,8 @@ background_changed (PanelBackground *background,
panel_toplevel_update_edges (toplevel);
panel_widget_emit_background_changed (toplevel->priv->panel_widget);
}
-
#endif
+
static void
panel_toplevel_init (PanelToplevel *toplevel)
{
@@ -5196,11 +4821,7 @@ panel_toplevel_init (PanelToplevel *toplevel)
toplevel->priv->panel_widget = NULL;
toplevel->priv->inner_frame = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
toplevel->priv->grid = NULL;
-#else
- toplevel->priv->table = NULL;
-#endif
toplevel->priv->hide_button_top = NULL;
toplevel->priv->hide_button_bottom = NULL;
toplevel->priv->hide_button_left = NULL;
@@ -5257,14 +4878,12 @@ panel_toplevel_init (PanelToplevel *toplevel)
(PanelBackgroundChangedNotify) background_changed,
toplevel);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
/*ensure the panel BG can always be themed*/
/*Without this gtk3.19/20 cannot set the BG color and resetting the bg to system is not immediately applied*/
GtkStyleContext *context;
context = gtk_widget_get_style_context (GTK_WIDGET (toplevel));
gtk_style_context_add_class(context,"gnome-panel-menu-bar");
gtk_style_context_add_class(context,"mate-panel-menu-bar");
-#endif
}
PanelWidget *
@@ -5474,7 +5093,6 @@ panel_toplevel_set_orientation (PanelToplevel *toplevel,
toplevel->priv->orientation = orientation;
-#if GTK_CHECK_VERSION(3, 0, 0)
GtkStyleContext* context = gtk_widget_get_style_context (GTK_WIDGET (toplevel));
if (orientation & PANEL_HORIZONTAL_MASK) {
gtk_style_context_add_class (context, GTK_STYLE_CLASS_HORIZONTAL);
@@ -5484,7 +5102,6 @@ panel_toplevel_set_orientation (PanelToplevel *toplevel,
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_HORIZONTAL);
}
gtk_widget_reset_style (GTK_WIDGET (toplevel));
-#endif
panel_toplevel_update_hide_buttons (toplevel);
diff --git a/mate-panel/panel-types.h b/mate-panel/panel-types.h
index 2d16942f..92862cbc 100644
--- a/mate-panel/panel-types.h
+++ b/mate-panel/panel-types.h
@@ -2,20 +2,10 @@
#ifndef PANEL_TYPES_H
#define PANEL_TYPES_H
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-
typedef enum {
PANEL_SPEED_SLOW,
PANEL_SPEED_MEDIUM,
PANEL_SPEED_FAST
} PanelSpeed;
-#if !GTK_CHECK_VERSION (3, 0, 0)
-typedef struct {
- GdkColor gdk;
- guint16 alpha;
-} PanelColor;
-#endif
-
#endif
diff --git a/mate-panel/panel-util.c b/mate-panel/panel-util.c
index 1567a73c..45b17b8d 100644
--- a/mate-panel/panel-util.c
+++ b/mate-panel/panel-util.c
@@ -116,11 +116,7 @@ panel_push_window_busy (GtkWidget *window)
GDK_WATCH);
gdk_window_set_cursor (win, cursor);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (cursor);
-#else
- gdk_cursor_unref (cursor);
-#endif
gdk_flush ();
}
}
@@ -325,11 +321,7 @@ panel_find_icon (GtkIconTheme *icon_theme,
if (info) {
retval = g_strdup (gtk_icon_info_get_filename (info));
-#if GTK_CHECK_VERSION (3, 8, 0)
g_object_unref (info);
-#else
- gtk_icon_info_free (info);
-#endif
} else
retval = NULL;
diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c
index 5bb4b6d3..2a2e1704 100644
--- a/mate-panel/panel-widget.c
+++ b/mate-panel/panel-widget.c
@@ -11,9 +11,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
#include <gtk/gtkx.h> /* for GTK_IS_SOCKET */
-#endif
#include <libpanel-util/panel-list.h>
@@ -62,7 +60,6 @@ static guint panel_widget_signals [LAST_SIGNAL] = {0};
static gboolean mate_panel_applet_in_drag = FALSE;
static GtkWidget *saved_focus_widget = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
static void panel_widget_get_preferred_size (GtkWidget *widget,
GtkRequisition *minimum_size,
GtkRequisition *natural_size);
@@ -72,10 +69,6 @@ static void panel_widget_get_preferred_width (GtkWidget *widget,
static void panel_widget_get_preferred_height (GtkWidget *widget,
gint *minimum_height,
gint *natural_height);
-#else
-static void panel_widget_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-#endif
static void panel_widget_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void panel_widget_cadd (GtkContainer *container,
@@ -85,23 +78,12 @@ static void panel_widget_cremove (GtkContainer *container,
static void panel_widget_dispose (GObject *obj);
static void panel_widget_finalize (GObject *obj);
-#if GTK_CHECK_VERSION (3, 18, 0)
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#if !GTK_CHECK_VERSION (3, 18, 0)
static void panel_widget_realize (GtkWidget *widget);
static void panel_widget_unrealize (GtkWidget *panel);
static void panel_widget_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state);
static void panel_widget_style_updated (GtkWidget *widget);
-#else
-static void panel_widget_realize (GtkWidget *widget);
-static void panel_widget_unrealize (GtkWidget *panel);
-static void panel_widget_state_changed (GtkWidget *widget,
- GtkStateType previous_state);
-static void panel_widget_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
-#endif
-
-#if !GTK_CHECK_VERSION (3, 18, 0)
static void panel_widget_background_changed (PanelBackground *background,
PanelWidget *panel);
#endif
@@ -138,11 +120,9 @@ static void
emit_applet_moved (PanelWidget *panel_widget,
AppletData *applet)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
/* we always want to queue a draw after moving, so do it here instead
* of after the signal emission in all callers */
gtk_widget_queue_draw (applet->applet);
-#endif
g_signal_emit (panel_widget,
panel_widget_signals [APPLET_MOVE_SIGNAL], 0,
applet->applet);
@@ -441,27 +421,17 @@ panel_widget_class_init (PanelWidgetClass *class)
object_class->dispose = panel_widget_dispose;
object_class->finalize = panel_widget_finalize;
-#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->get_preferred_width = panel_widget_get_preferred_width;
widget_class->get_preferred_height = panel_widget_get_preferred_height;
-#else
- widget_class->size_request = panel_widget_size_request;
-#endif
widget_class->size_allocate = panel_widget_size_allocate;
#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_class_set_css_name (widget_class, "PanelWidget");
#endif
-#if GTK_CHECK_VERSION (3, 18, 0)
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#if !GTK_CHECK_VERSION (3, 18, 0)
widget_class->realize = panel_widget_realize;
widget_class->unrealize = panel_widget_unrealize;
widget_class->state_flags_changed = panel_widget_state_flags_changed;
widget_class->style_updated = panel_widget_style_updated;
-#else
- widget_class->realize = panel_widget_realize;
- widget_class->unrealize = panel_widget_unrealize;
- widget_class->state_changed = panel_widget_state_changed;
- widget_class->style_set = panel_widget_style_set;
#endif
widget_class->focus = panel_widget_real_focus;
@@ -1236,13 +1206,9 @@ panel_widget_right_stick(PanelWidget *panel,int old_size)
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_widget_get_preferred_size(GtkWidget *widget,
GtkRequisition *minimum_size,
GtkRequisition *natural_size)
-#else
-panel_widget_size_request(GtkWidget *widget, GtkRequisition *minimum_size)
-#endif
{
PanelWidget *panel;
GList *list;
@@ -1261,34 +1227,26 @@ panel_widget_size_request(GtkWidget *widget, GtkRequisition *minimum_size)
minimum_size->height = 0;
minimum_size->width = panel->sz;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
natural_size->width = minimum_size->width;
natural_size->height = minimum_size->height;
-#endif
ad_with_hints = NULL;
for (list = panel->applet_list; list!=NULL; list = g_list_next(list)) {
AppletData *ad = list->data;
GtkRequisition child_min_size;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkRequisition child_natural_size;
gtk_widget_get_preferred_size(ad->applet,
&child_min_size,
&child_natural_size);
-#else
- gtk_widget_size_request(ad->applet, &child_min_size);
-#endif
if (panel->orient == GTK_ORIENTATION_HORIZONTAL) {
if (minimum_size->height < child_min_size.height &&
!ad->size_constrained)
minimum_size->height = child_min_size.height;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (natural_size->height < child_natural_size.height &&
!ad->size_constrained)
natural_size->height = child_natural_size.height;
-#endif
if (panel->packed && ad->expand_major && ad->size_hints)
ad_with_hints = g_list_prepend (ad_with_hints,
@@ -1297,19 +1255,15 @@ panel_widget_size_request(GtkWidget *widget, GtkRequisition *minimum_size)
else if (panel->packed)
{
minimum_size->width += child_min_size.width;
-#if GTK_CHECK_VERSION (3, 0, 0)
natural_size->width += child_natural_size.width;
-#endif
}
} else {
if (minimum_size->width < child_min_size.width &&
!ad->size_constrained)
minimum_size->width = child_min_size.width;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (natural_size->width < child_min_size.width &&
!ad->size_constrained)
natural_size->width = child_min_size.width;
-#endif
if (panel->packed && ad->expand_major && ad->size_hints)
ad_with_hints = g_list_prepend (ad_with_hints,
@@ -1318,9 +1272,7 @@ panel_widget_size_request(GtkWidget *widget, GtkRequisition *minimum_size)
else if (panel->packed)
{
minimum_size->height += child_min_size.height;
-#if GTK_CHECK_VERSION (3, 0, 0)
natural_size->height += child_natural_size.height;
-#endif
}
}
}
@@ -1336,14 +1288,10 @@ panel_widget_size_request(GtkWidget *widget, GtkRequisition *minimum_size)
if (!panel->packed) {
if (panel->orient == GTK_ORIENTATION_HORIZONTAL) {
minimum_size->width = panel->size;
-#if GTK_CHECK_VERSION (3, 0, 0)
natural_size->width = panel->size;
-#endif
} else {
minimum_size->height = panel->size;
-#if GTK_CHECK_VERSION (3, 0, 0)
natural_size->height = panel->size;
-#endif
}
} else {
/* put the list in the correct order: this is important
@@ -1377,27 +1325,22 @@ panel_widget_size_request(GtkWidget *widget, GtkRequisition *minimum_size)
minimum_size->width = 12;
if (minimum_size->height < 12)
minimum_size->height = 12;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (natural_size->width < 12 && !dont_fill)
natural_size->width = 12;
if (natural_size->height < 12)
natural_size->height = 12;
-#endif
} else {
if (minimum_size->width < 12)
minimum_size->width = 12;
if (minimum_size->height < 12 && !dont_fill)
minimum_size->height = 12;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (natural_size->width < 12)
natural_size->width = 12;
if (natural_size->height < 12 && !dont_fill)
natural_size->height = 12;
-#endif
}
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
panel_widget_get_preferred_width(GtkWidget *widget,
gint *minimum_width,
@@ -1419,7 +1362,6 @@ panel_widget_get_preferred_height(GtkWidget *widget,
*minimum_height = req_min.height;
*natural_height = req_natural.height;
}
-#endif
static void
queue_resize_on_all_applets(PanelWidget *panel)
@@ -1499,11 +1441,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
AppletData *ad = list->data;
GtkAllocation challoc;
GtkRequisition chreq;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (ad->applet, &chreq, NULL);
-#else
- gtk_widget_get_child_requisition(ad->applet, &chreq);
-#endif
ad->constrained = i;
@@ -1554,11 +1492,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
AppletData *ad = list->data;
GtkRequisition chreq;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (ad->applet, &chreq, NULL);
-#else
- gtk_widget_get_child_requisition(ad->applet, &chreq);
-#endif
if (!ad->expand_major || !ad->size_hints) {
if(panel->orient == GTK_ORIENTATION_HORIZONTAL)
@@ -1628,11 +1562,8 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
AppletData *ad = list->data;
GtkAllocation challoc;
GtkRequisition chreq;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (ad->applet, &chreq, NULL);
-#else
- gtk_widget_get_child_requisition (ad->applet, &chreq);
-#endif
+
challoc.width = chreq.width;
challoc.height = chreq.height;
if(panel->orient == GTK_ORIENTATION_HORIZONTAL) {
@@ -1668,9 +1599,7 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
{
GtkWidget *widget;
GtkAllocation allocation;
-#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *device;
-#endif
int x,y;
int w,h;
@@ -1686,11 +1615,9 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
#if GTK_CHECK_VERSION(3, 20, 0)
device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (widget)));
gdk_window_get_device_position(gtk_widget_get_window (widget), device, &x, &y, NULL);
-#elif GTK_CHECK_VERSION(3, 0, 0)
+#else
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (widget)));
gdk_window_get_device_position(gtk_widget_get_window (widget), device, &x, &y, NULL);
-#else
- gtk_widget_get_pointer(widget, &x, &y);
#endif
gtk_widget_get_allocation (widget, &allocation);
@@ -1705,8 +1632,7 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
return FALSE;
}
-#if GTK_CHECK_VERSION (3, 18, 0)
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#if !GTK_CHECK_VERSION (3, 18, 0)
static void
panel_widget_set_background_default_style (GtkWidget *widget)
{
@@ -1750,43 +1676,6 @@ panel_widget_style_updated (GtkWidget *widget)
GTK_WIDGET_CLASS (panel_widget_parent_class)->style_updated (widget);
panel_widget_set_background_default_style (widget);
}
-
-#else
-
-static void
-panel_widget_state_changed (GtkWidget *widget,
- GtkStateType previous_state)
-{
- GtkStyle *style;
- GtkStateType state;
-
- if (gtk_widget_get_realized (widget)) {
- style = gtk_widget_get_style (widget);
- state = gtk_widget_get_state (widget);
-
- panel_background_set_default_style (
- &PANEL_WIDGET (widget)->background,
- &style->bg [state],
- style->bg_pixmap [state]);
- }
-}
-
-static void
-panel_widget_style_set (GtkWidget *widget, GtkStyle *previous_style)
-{
- GtkStyle *style;
- GtkStateType state;
-
- if (gtk_widget_get_realized (widget)) {
- style = gtk_widget_get_style (widget);
- state = gtk_widget_get_state (widget);
-
- panel_background_set_default_style (
- &PANEL_WIDGET (widget)->background,
- &style->bg [state],
- style->bg_pixmap [state]);
- }
-}
#endif
static gboolean
@@ -1806,10 +1695,6 @@ panel_widget_realize (GtkWidget *widget)
{
PanelWidget *panel = (PanelWidget *) widget;
GdkWindow *window;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GtkStyle *style;
- GtkStateType state;
-#endif
g_signal_connect (panel->toplevel, "configure-event",
G_CALLBACK (toplevel_configure_event), panel);
@@ -1817,23 +1702,8 @@ panel_widget_realize (GtkWidget *widget)
GTK_WIDGET_CLASS (panel_widget_parent_class)->realize (widget);
window = gtk_widget_get_window (widget);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- style = gtk_widget_get_style (widget);
- state = gtk_widget_get_state (widget);
-
- /* For auto-hidden panels with a colored background, we need native
- * windows to avoid some uglyness on unhide */
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
panel_widget_set_background_default_style (widget);
-#else
- panel_background_set_default_style (
- &panel->background,
- &style->bg [state],
- style->bg_pixmap [state]);
-#endif
panel_background_realized (&panel->background, window);
}
@@ -1939,11 +1809,7 @@ panel_widget_init (PanelWidget *panel)
panel->packed = FALSE;
panel->orient = GTK_ORIENTATION_HORIZONTAL;
-#if GTK_CHECK_VERSION (3, 0, 0)
panel->size = 0;
-#else
- panel->size = G_MAXINT;
-#endif
panel->applet_list = NULL;
panel->master_widget = NULL;
panel->drop_widget = widget;
@@ -1957,7 +1823,6 @@ panel_widget_init (PanelWidget *panel)
(PanelBackgroundChangedNotify) panel_widget_background_changed,
panel);
#endif
-
panels = g_slist_append (panels, panel);
}
@@ -1978,14 +1843,7 @@ panel_widget_new (PanelToplevel *toplevel,
panel->sz = sz;
panel->packed = packed;
-#if GTK_CHECK_VERSION (3, 0, 0)
panel->size = 0;
-#else
- if (packed)
- panel->size = 0;
- else
- panel->size = G_MAXINT;
-#endif
panel->toplevel = toplevel;
panel->drop_widget = GTK_WIDGET (toplevel);
@@ -2094,7 +1952,6 @@ panel_widget_applet_drag_start (PanelWidget *panel,
if (window) {
GdkGrabStatus status;
GdkCursor *fleur_cursor;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
#if GTK_CHECK_VERSION(3, 20, 0)
GdkSeat *seat;
@@ -2102,12 +1959,9 @@ panel_widget_applet_drag_start (PanelWidget *panel,
GdkDevice *pointer;
GdkDeviceManager *device_manager;
#endif
-#endif
-
fleur_cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
GDK_FLEUR);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_window_get_display (window);
#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat (display);
@@ -2124,12 +1978,6 @@ panel_widget_applet_drag_start (PanelWidget *panel,
#endif
g_object_unref (fleur_cursor);
-#else
- status = gdk_pointer_grab (window, FALSE,
- APPLET_EVENT_MASK, NULL,
- fleur_cursor, time_);
- gdk_cursor_unref (fleur_cursor);
-#endif
gdk_flush ();
if (status != GDK_GRAB_SUCCESS) {
@@ -2146,7 +1994,7 @@ panel_widget_applet_drag_end (PanelWidget *panel)
#if GTK_CHECK_VERSION(3, 20, 0)
GdkDisplay *display;
GdkSeat *seat;
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
GdkDisplay *display;
GdkDevice *pointer;
GdkDeviceManager *device_manager;
@@ -2161,14 +2009,12 @@ panel_widget_applet_drag_end (PanelWidget *panel)
seat = gdk_display_get_default_seat (display);
gdk_seat_ungrab (seat);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
display = gtk_widget_get_display (GTK_WIDGET (panel));
device_manager = gdk_display_get_device_manager (display);
pointer = gdk_device_manager_get_client_pointer (device_manager);
gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
-#else
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
#endif
gtk_grab_remove (panel->currently_dragged_applet->applet);
panel_widget_applet_drag_end_no_grab (panel);
@@ -2180,9 +2026,7 @@ panel_widget_applet_drag_end (PanelWidget *panel)
int
panel_widget_get_cursorloc (PanelWidget *panel)
{
-#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *device;
-#endif
int x, y;
gboolean rtl;
@@ -2191,11 +2035,9 @@ panel_widget_get_cursorloc (PanelWidget *panel)
#if GTK_CHECK_VERSION (3, 20, 0)
device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET(panel))));
gdk_window_get_device_position(gtk_widget_get_window (GTK_WIDGET(panel)), device, &x, &y, NULL);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET(panel))));
gdk_window_get_device_position(gtk_widget_get_window (GTK_WIDGET(panel)), device, &x, &y, NULL);
-#else
- gtk_widget_get_pointer (GTK_WIDGET (panel), &x, &y);
#endif
rtl = gtk_widget_get_direction (GTK_WIDGET (panel)) == GTK_TEXT_DIR_RTL;
@@ -2363,9 +2205,7 @@ panel_widget_applet_move_to_cursor (PanelWidget *panel)
int pos;
int movement;
GtkWidget *applet;
-#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *device;
-#endif
GSList *forb;
GdkModifierType mods;
AppletData *ad;
@@ -2424,12 +2264,9 @@ panel_widget_applet_move_to_cursor (PanelWidget *panel)
#if GTK_CHECK_VERSION (3, 20, 0)
device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (panel))));
gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET(panel)), device, NULL, NULL, &mods);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (panel))));
gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET(panel)), device, NULL, NULL, &mods);
-#else
- gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET(panel)),
- NULL, NULL, &mods);
#endif
movement = PANEL_SWITCH_MOVE;
@@ -2464,9 +2301,7 @@ static int
move_timeout_handler(gpointer data)
{
PanelWidget *panel = data;
-#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *device;
-#endif
g_return_val_if_fail(PANEL_IS_WIDGET(data),FALSE);
@@ -2489,11 +2324,9 @@ move_timeout_handler(gpointer data)
#if GTK_CHECK_VERSION (3, 20, 0)
device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (widget)));
gdk_window_get_device_position (gtk_widget_get_window (widget), device, &x, &y, NULL);
-#elif GTK_CHECK_VERSION (3, 0, 0)
+#else
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (widget)));
gdk_window_get_device_position(gtk_widget_get_window (widget), device, &x, &y, NULL);
-#else
- gtk_widget_get_pointer(widget, &x, &y);
#endif
gtk_widget_get_allocation (widget, &allocation);
@@ -2629,11 +2462,7 @@ panel_widget_applet_key_press_event (GtkWidget *widget,
if (!mate_panel_applet_in_drag)
return FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
return gtk_bindings_activate (G_OBJECT (panel),
-#else
- return gtk_bindings_activate (GTK_OBJECT (panel),
-#endif
((GdkEventKey *)event)->keyval,
((GdkEventKey *)event)->state);
}
@@ -3003,7 +2832,6 @@ panel_widget_emit_background_changed (PanelWidget *panel)
{
g_signal_emit (panel, panel_widget_signals [BACK_CHANGE_SIGNAL], 0);
}
-
#else
static void
panel_widget_background_changed (PanelBackground *background,
diff --git a/mate-panel/panel-xutils.c b/mate-panel/panel-xutils.c
index 0abce77c..413bd40e 100644
--- a/mate-panel/panel-xutils.c
+++ b/mate-panel/panel-xutils.c
@@ -27,7 +27,6 @@
#include "panel-xutils.h"
#include <glib.h>
-#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <X11/Xlib.h>
@@ -102,11 +101,7 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
XChangeProperty (display, window, net_wm_strut_partial,
XA_CARDINAL, 32, PropModeReplace,
(guchar *) &struts, 12);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
-#else
- gdk_error_trap_pop ();
-#endif
}
void
@@ -124,11 +119,7 @@ panel_warp_pointer (GdkWindow *gdk_window,
gdk_error_trap_push ();
XWarpPointer (display, None, window, 0, 0, 0, 0, x, y);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
-#else
- gdk_error_trap_pop ();
-#endif
}
guint
diff --git a/mate-panel/panel.c b/mate-panel/panel.c
index 206b6c82..f3bf417b 100644
--- a/mate-panel/panel.c
+++ b/mate-panel/panel.c
@@ -19,9 +19,7 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
#include <gtk/gtkx.h> /* for GTK_IS_SOCKET */
-#endif
#include <libpanel-util/panel-glib.h>
@@ -404,11 +402,7 @@ panel_key_press_event (GtkWidget *widget,
if (GTK_IS_SOCKET (gtk_window_get_focus (GTK_WINDOW (widget))) &&
event->keyval == GDK_KEY_F10 &&
(event->state & gtk_accelerator_get_default_mod_mask ()) == GDK_CONTROL_MASK)
-#if GTK_CHECK_VERSION (3, 0, 0)
return gtk_bindings_activate (G_OBJECT (widget),
-#else
- return gtk_bindings_activate (GTK_OBJECT (widget),
-#endif
event->keyval,
event->state);
@@ -440,11 +434,7 @@ static gboolean
set_background_color (PanelToplevel *toplevel,
guint16 *dropped)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
-#else
- PanelColor color;
-#endif
if (!dropped)
return FALSE;
@@ -453,17 +443,10 @@ set_background_color (PanelToplevel *toplevel,
! panel_profile_background_key_is_writable (toplevel, "type"))
return FALSE;
-#if GTK_CHECK_VERSION (3, 0, 0)
color.red = dropped [0];
color.green = dropped [1];
color.blue = dropped [2];
color.alpha = 1.;
-#else
- color.gdk.red = dropped [0];
- color.gdk.green = dropped [1];
- color.gdk.blue = dropped [2];
- color.alpha = 65535;
-#endif
panel_profile_set_background_color (toplevel, &color);
panel_profile_set_background_type (toplevel, PANEL_BACK_COLOR);
diff --git a/mate-panel/xstuff.c b/mate-panel/xstuff.c
index 42dc3b78..7753973e 100644
--- a/mate-panel/xstuff.c
+++ b/mate-panel/xstuff.c
@@ -217,11 +217,7 @@ xstuff_set_pos_size (GdkWindow *window, int x, int y, int w, int h)
gdk_window_move_resize (window, x, y, w, h);
gdk_flush ();
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_error_trap_pop_ignored ();
-#else
- gdk_error_trap_pop ();
-#endif
g_object_set_data (G_OBJECT (window), "xstuff-cached-x", GINT_TO_POINTER (x));
g_object_set_data (G_OBJECT (window), "xstuff-cached-y", GINT_TO_POINTER (y));
@@ -318,13 +314,8 @@ idle_destroy (gpointer data)
}
static gboolean
-#if GTK_CHECK_VERSION (3, 0, 0)
zoom_draw (GtkWidget *widget,
cairo_t *cr,
-#else
-zoom_expose (GtkWidget *widget,
- GdkEventExpose *event,
-#endif
gpointer user_data)
{
CompositedZoomData *zoom;
@@ -347,9 +338,6 @@ zoom_expose (GtkWidget *widget,
GdkPixbuf *scaled;
int width, height;
int x = 0, y = 0;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *cr;
-#endif
gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
@@ -382,9 +370,6 @@ zoom_expose (GtkWidget *widget,
break;
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
-#endif
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba (cr, 0, 0, 0, 0.0);
cairo_rectangle (cr, 0, 0, width, height);
@@ -394,9 +379,6 @@ zoom_expose (GtkWidget *widget,
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_paint_with_alpha (cr, MAX (zoom->opacity, 0));
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_destroy (cr);
-#endif
g_object_unref (scaled);
}
@@ -431,11 +413,7 @@ draw_zoom_animation_composited (GdkScreen *gscreen,
gtk_window_set_keep_above (GTK_WINDOW (win), TRUE);
gtk_window_set_decorated (GTK_WINDOW (win), FALSE);
gtk_widget_set_app_paintable(win, TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_visual (win, gdk_screen_get_rgba_visual (gscreen));
-#else
- gtk_widget_set_colormap (win, gdk_screen_get_rgba_colormap (gscreen));
-#endif
gtk_window_set_gravity (GTK_WINDOW (win), GDK_GRAVITY_STATIC);
gtk_window_set_default_size (GTK_WINDOW (win),
@@ -465,21 +443,12 @@ draw_zoom_animation_composited (GdkScreen *gscreen,
gtk_window_move (GTK_WINDOW (win), wx, wy);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect (G_OBJECT (win), "draw",
G_CALLBACK (zoom_draw), zoom);
-#else
- g_signal_connect (G_OBJECT (win), "expose-event",
- G_CALLBACK (zoom_expose), zoom);
-#endif
/* see doc for gtk_widget_set_app_paintable() */
gtk_widget_realize (win);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_window_set_background_pattern (gtk_widget_get_window (win), NULL);
-#else
- gdk_window_set_back_pixmap (gtk_widget_get_window (win), NULL, FALSE);
-#endif
gtk_widget_show (win);
zoom->timeout_id = g_timeout_add (ZOOM_DELAY,
@@ -509,17 +478,9 @@ draw_zoom_animation (GdkScreen *gscreen,
dpy = gdk_x11_display_get_xdisplay (gdk_screen_get_display (gscreen));
root_win = GDK_WINDOW_XID (gdk_screen_get_root_window (gscreen));
screen = gdk_screen_get_number (gscreen);
-#if GTK_CHECK_VERSION (3, 0, 0)
depth = DefaultDepth(dpy,screen);
-#else
- depth = gdk_drawable_get_depth (gdk_screen_get_root_window (gscreen));
-#endif
/* frame GC */
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_colormap_alloc_color (
- gdk_screen_get_system_colormap (gscreen), &color, FALSE, TRUE);
-#endif
gcv.function = GXxor;
/* this will raise the probability of the XORed color being different
* of the original color in PseudoColor when not all color cells are
@@ -610,10 +571,6 @@ draw_zoom_animation (GdkScreen *gscreen,
XUngrabServer(dpy);
XFreeGC (dpy, frame_gc);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_colormap_free_colors (gdk_screen_get_system_colormap (gscreen),
- &color, 1);
-#endif
}
#undef FRAMES
@@ -709,11 +666,7 @@ xstuff_grab_key_on_all_screens (int keycode,
int i;
display = gdk_display_get_default ();
-#if GTK_CHECK_VERSION(3, 10, 0)
n_screens = 1; /* gdk-3.10, The number of screens is always 1 */
-#else
- n_screens = gdk_display_get_n_screens (display);
-#endif
for (i = 0; i < n_screens; i++) {
GdkWindow *root;