summaryrefslogtreecommitdiff
path: root/capplets
diff options
context:
space:
mode:
authormonsta <[email protected]>2018-01-28 22:42:47 +0300
committerraveit65 <[email protected]>2018-01-30 20:11:14 +0100
commit2be32a55532fbb010f83472064435aae49e36270 (patch)
tree8a57f8d9d0b17ea7d4277c5d167c6eee4d0164b8 /capplets
parent312edc87dae270e11ce2955c7c26b3387ae94985 (diff)
downloadmate-control-center-2be32a55532fbb010f83472064435aae49e36270.tar.bz2
mate-control-center-2be32a55532fbb010f83472064435aae49e36270.tar.xz
require GTK+ 3.22 and GLib 2.50
Diffstat (limited to 'capplets')
-rw-r--r--capplets/appearance/appearance-desktop.c10
-rw-r--r--capplets/appearance/appearance-style.c4
-rw-r--r--capplets/appearance/appearance-themes.c4
-rw-r--r--capplets/common/capplet-util.c14
-rw-r--r--capplets/common/file-transfer-dialog.c4
-rw-r--r--capplets/display/scrollarea.c13
-rw-r--r--capplets/keybindings/eggcellrendererkeys.c67
-rw-r--r--capplets/windows/mate-metacity-support.c4
-rw-r--r--capplets/windows/mate-window-properties.c8
9 files changed, 1 insertions, 127 deletions
diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c
index ee5d1427..545f6c12 100644
--- a/capplets/appearance/appearance-desktop.c
+++ b/capplets/appearance/appearance-desktop.c
@@ -883,20 +883,12 @@ static gdouble
get_monitor_aspect_ratio_for_widget (GtkWidget *widget)
{
gdouble aspect;
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor;
-#else
- gint monitor;
-#endif
GdkRectangle rect;
-#if GTK_CHECK_VERSION (3, 22, 0)
monitor = gdk_display_get_monitor_at_window (gtk_widget_get_display (widget), gtk_widget_get_window (widget));
gdk_monitor_get_geometry (monitor, &rect);
-#else
- monitor = gdk_screen_get_monitor_at_window (gtk_widget_get_screen (widget), gtk_widget_get_window (widget));
- gdk_screen_get_monitor_geometry (gtk_widget_get_screen (widget), monitor, &rect);
-#endif
+
aspect = rect.height / (gdouble)rect.width;
return aspect;
diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c
index afd892b6..161917c2 100644
--- a/capplets/appearance/appearance-style.c
+++ b/capplets/appearance/appearance-style.c
@@ -234,11 +234,7 @@ static void update_message_area(AppearanceData* data)
data->style_message_label = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (data->style_message_label), TRUE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (data->style_message_label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (data->style_message_label), 0.0, 0.5);
-#endif
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
icon = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG);
diff --git a/capplets/appearance/appearance-themes.c b/capplets/appearance/appearance-themes.c
index 0025e90e..07c41507 100644
--- a/capplets/appearance/appearance-themes.c
+++ b/capplets/appearance/appearance-themes.c
@@ -661,11 +661,7 @@ theme_message_area_update (AppearanceData *data)
data->theme_message_label = gtk_label_new (NULL);
gtk_widget_show (data->theme_message_label);
gtk_label_set_line_wrap (GTK_LABEL (data->theme_message_label), TRUE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (data->theme_message_label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (data->theme_message_label), 0.0, 0.5);
-#endif
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
gtk_widget_show (hbox);
diff --git a/capplets/common/capplet-util.c b/capplets/common/capplet-util.c
index 3f9e4b53..d2458d9b 100644
--- a/capplets/common/capplet-util.c
+++ b/capplets/common/capplet-util.c
@@ -71,26 +71,12 @@ capplet_help (GtkWindow *parent, char const *section)
{
GError *error = NULL;
char *uri;
-#if !GTK_CHECK_VERSION (3, 22, 0)
- GdkScreen *screen;
-#endif
g_return_if_fail (section != NULL);
-#if !GTK_CHECK_VERSION (3, 22, 0)
- if (!parent)
- screen = gdk_screen_get_default ();
- else
- screen = gtk_widget_get_screen (GTK_WIDGET (parent));
-#endif
-
uri = g_strdup_printf ("help:mate-user-guide/%s", section);
-#if GTK_CHECK_VERSION (3, 22, 0)
if (!gtk_show_uri_on_window (parent , uri, gtk_get_current_event_time (), &error)) {
-#else
- if (!gtk_show_uri (screen, uri, gtk_get_current_event_time (), &error)) {
-#endif
capplet_error_dialog (
parent,
_("There was an error displaying help: %s"),
diff --git a/capplets/common/file-transfer-dialog.c b/capplets/common/file-transfer-dialog.c
index 03747935..8d2c2ec4 100644
--- a/capplets/common/file-transfer-dialog.c
+++ b/capplets/common/file-transfer-dialog.c
@@ -313,12 +313,8 @@ file_transfer_dialog_init (FileTransferDialog *dlg)
gtk_label_set_markup (GTK_LABEL (dlg->priv->status), markup);
g_free (markup);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (dlg->priv->status), 0.0);
gtk_label_set_yalign (GTK_LABEL (dlg->priv->status), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (dlg->priv->status), 0.0, 0.0);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), dlg->priv->status, FALSE, FALSE, 0);
diff --git a/capplets/display/scrollarea.c b/capplets/display/scrollarea.c
index 17936130..0bd8cca3 100644
--- a/capplets/display/scrollarea.c
+++ b/capplets/display/scrollarea.c
@@ -527,12 +527,8 @@ emit_viewport_changed (FooScrollArea *scroll_area,
GdkRectangle *new_viewport,
GdkRectangle *old_viewport)
{
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkDisplay *display;
GdkSeat *seat;
-#else
- GdkDeviceManager *manager;
-#endif
GdkDevice *pointer;
int px, py;
@@ -542,14 +538,9 @@ emit_viewport_changed (FooScrollArea *scroll_area,
if (scroll_area->priv->input_window == NULL)
return;
-#if GTK_CHECK_VERSION (3, 20, 0)
display = gdk_window_get_display (scroll_area->priv->input_window);
seat = gdk_display_get_default_seat (display);
pointer = gdk_seat_get_pointer (seat);
-#else
- manager = gdk_display_get_device_manager (gdk_window_get_display (scroll_area->priv->input_window));
- pointer = gdk_device_manager_get_client_pointer (manager);
-#endif
gdk_window_get_device_position (scroll_area->priv->input_window,
pointer,
&px,
@@ -568,10 +559,6 @@ clamp_adjustment (GtkAdjustment *adj)
- gtk_adjustment_get_page_size (adj)));
else
gtk_adjustment_set_value (adj, 0.0);
-
-#if !GTK_CHECK_VERSION (3,18,0)
- gtk_adjustment_changed (adj);
-#endif
}
static gboolean
diff --git a/capplets/keybindings/eggcellrendererkeys.c b/capplets/keybindings/eggcellrendererkeys.c
index af96f332..828c1fab 100644
--- a/capplets/keybindings/eggcellrendererkeys.c
+++ b/capplets/keybindings/eggcellrendererkeys.c
@@ -378,13 +378,7 @@ static gboolean grab_key_callback(GtkWidget* widget, GdkEventKey* event, void* d
guint upper;
GdkModifierType ignored_modifiers;
GdkDisplay *display;
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkSeat *seat;
-#else
- GdkDevice *pointer;
- GdkDevice *keyboard;
- GdkDeviceManager *device_manager;
-#endif
keys = EGG_CELL_RENDERER_KEYS(data);
@@ -471,18 +465,9 @@ static gboolean grab_key_callback(GtkWidget* widget, GdkEventKey* event, void* d
out:
display = gtk_widget_get_display (widget);
-#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat (display);
gdk_seat_ungrab (seat);
-#else
- device_manager = gdk_display_get_device_manager (display);
- keyboard = gdk_device_get_associated_device (pointer);
- pointer = gdk_device_manager_get_client_pointer (device_manager);
-
- gdk_device_ungrab (keyboard, event->time);
- gdk_device_ungrab (pointer, event->time);
-#endif
path = g_strdup(g_object_get_data(G_OBJECT(keys->edit_widget), EGG_CELL_RENDERER_TEXT_PATH));
@@ -508,27 +493,12 @@ static void ungrab_stuff(GtkWidget* widget, gpointer data)
{
EggCellRendererKeys* keys = EGG_CELL_RENDERER_KEYS(data);
GdkDisplay *display;
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkSeat *seat;
-#else
- GdkDevice *keyboard;
- GdkDevice *pointer;
- GdkDeviceManager *device_manager;
-#endif
display = gtk_widget_get_display (widget);
-#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat (display);
gdk_seat_ungrab (seat);
-#else
- device_manager = gdk_display_get_device_manager (display);
- keyboard = gdk_device_get_associated_device (pointer);
- pointer = gdk_device_manager_get_client_pointer (device_manager);
-
- gdk_device_ungrab (keyboard, GDK_CURRENT_TIME);
- gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
-#endif
g_signal_handlers_disconnect_by_func(G_OBJECT(keys->grab_widget), G_CALLBACK(grab_key_callback), data);
}
@@ -589,13 +559,7 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell,
GtkCellRendererText *celltext;
EggCellRendererKeys *keys;
GdkDisplay *display;
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkSeat *seat;
-#else
- GdkDeviceManager *device_manager;
- GdkDevice *keyboard;
- GdkDevice *pointer;
-#endif
GtkWidget *label;
GtkWidget *eventbox;
GValue celltext_editable = {0};
@@ -611,7 +575,6 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell,
g_return_val_if_fail (gtk_widget_get_window (widget) != NULL, NULL);
display = gtk_widget_get_display (widget);
-#if GTK_CHECK_VERSION (3, 20, 0)
seat = gdk_display_get_default_seat (display);
if (gdk_seat_grab (seat,
@@ -623,32 +586,6 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell,
NULL,
NULL) != GDK_GRAB_SUCCESS)
return NULL;
-#else
- device_manager = gdk_display_get_device_manager (display);
- pointer = gdk_device_manager_get_client_pointer (device_manager);
- keyboard = gdk_device_get_associated_device (pointer);
-
- if (gdk_device_grab (keyboard,
- gtk_widget_get_window (widget),
- GDK_OWNERSHIP_NONE,
- FALSE,
- GDK_KEY_PRESS_MASK,
- NULL,
- gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
- return NULL;
-
- if (gdk_device_grab (pointer,
- gtk_widget_get_window (widget),
- GDK_OWNERSHIP_NONE,
- FALSE,
- GDK_BUTTON_PRESS_MASK,
- NULL,
- gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
- {
- gdk_device_ungrab (keyboard, gdk_event_get_time (event));
- return NULL;
- }
-#endif
keys->grab_widget = widget;
@@ -663,11 +600,7 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell,
(void**) &keys->edit_widget);
label = gtk_label_new (NULL);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_widget_modify_bg (eventbox, GTK_STATE_NORMAL,
&gtk_widget_get_style (widget)->bg[GTK_STATE_SELECTED]);
diff --git a/capplets/windows/mate-metacity-support.c b/capplets/windows/mate-metacity-support.c
index 079b18d1..d5964444 100644
--- a/capplets/windows/mate-metacity-support.c
+++ b/capplets/windows/mate-metacity-support.c
@@ -52,11 +52,7 @@ mate_metacity_config_tool ()
widget = gtk_label_new (str);
g_free (str);
gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (widget), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
widget = gtk_check_button_new_with_label (_("Enable software _compositing window manager"));
diff --git a/capplets/windows/mate-window-properties.c b/capplets/windows/mate-window-properties.c
index ecc71247..bf5ab4cb 100644
--- a/capplets/windows/mate-window-properties.c
+++ b/capplets/windows/mate-window-properties.c
@@ -303,12 +303,8 @@ title_label_new (const char* title)
g_free (str);
gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (widget), 0.0);
gtk_label_set_yalign (GTK_LABEL (widget), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.0);
-#endif
return widget;
}
@@ -492,12 +488,8 @@ main (int argc, char **argv)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
widget = gtk_label_new_with_mnemonic (_("To move a window, press-and-hold this key then grab the window:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (widget), 0.0);
gtk_label_set_yalign (GTK_LABEL (widget), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.0);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 6);
alt_click_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);