Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15:Update
mate-panel
mate-panel-gtk-3.20.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mate-panel-gtk-3.20.patch of Package mate-panel
--- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -874,9 +874,17 @@ position_calendar_popup (ClockData *cd) screen = gtk_window_get_screen (GTK_WINDOW (cd->calendar_popup)); display = gdk_screen_get_display (screen); +#if GTK_CHECK_VERSION (3, 22, 0) n = gdk_display_get_n_monitors (display); +#else + n = gdk_screen_get_n_monitors (screen); +#endif for (i = 0; i < n; i++) { +#if GTK_CHECK_VERSION (3, 22, 0) gdk_monitor_get_geometry (gdk_display_get_monitor (display, i), &monitor); +#else + gdk_screen_get_monitor_geometry (screen, i, &monitor); +#endif if (x >= monitor.x && x <= monitor.x + monitor.width && y >= monitor.y && y <= monitor.y + monitor.height) { found_monitor = TRUE; --- a/applets/clock/clock-utils.c +++ b/applets/clock/clock-utils.c @@ -73,8 +73,13 @@ clock_utils_display_help (GtkWidget *wi else uri = g_strdup_printf ("help:%s", doc_id); +#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, uri, gtk_get_current_event_time (), &error); +#else + gtk_show_uri (gtk_widget_get_screen (widget), uri, + gtk_get_current_event_time (), &error); +#endif g_free (uri); if (error && --- a/applets/fish/fish.c +++ b/applets/fish/fish.c @@ -153,8 +153,13 @@ static void show_help(FishApplet* fish, else uri = g_strdup_printf ("help:%s", FISH_HELP_DOC); +#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, uri, gtk_get_current_event_time (), &error); +#else + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (fish)), uri, + gtk_get_current_event_time (), &error); +#endif g_free (uri); if (error && --- a/applets/notification_area/main.c +++ b/applets/notification_area/main.c @@ -111,7 +111,12 @@ static void help_cb(GtkAction* action, N #define NA_HELP_DOC "mate-user-guide" uri = g_strdup_printf("help:%s/%s", NA_HELP_DOC, "panels-notification-area"); +#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, uri, gtk_get_current_event_time (), &error); +#else + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (applet)), uri, + gtk_get_current_event_time (), &error); +#endif g_free(uri); if (error && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) --- a/applets/notification_area/status-notifier/sn-dbus-menu.c +++ b/applets/notification_area/status-notifier/sn-dbus-menu.c @@ -188,9 +188,11 @@ get_layout_cb (GObject *source_obje g_hash_table_remove_all (menu->items); layout_parse (menu, layout, GTK_MENU (menu)); +#if GTK_CHECK_VERSION (3, 22, 0) /* Reposition menu to accomodate any size changes */ /* Menu size never changes with GTK 3.20 or earlier */ gtk_menu_reposition(GTK_MENU(menu)); +#endif g_variant_unref (layout); } --- a/applets/notification_area/status-notifier/sn-item.c +++ b/applets/notification_area/status-notifier/sn-item.c @@ -182,6 +182,49 @@ sn_item_get_action_coordinates (SnItem * *x += width; } +#if !GTK_CHECK_VERSION (3, 22, 0) +static void +sn_item_popup_menu_position_func (GtkMenu *menu, + int *x, + int *y, + gboolean *push_in, + gpointer widget) +{ + GtkAllocation widget_alloc; + GtkRequisition menu_req; + GdkWindow *window; + GdkScreen *screen; + int monitor_num; + GdkRectangle monitor; + + gtk_widget_get_allocation (widget, &widget_alloc); + gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_req, NULL); + + window = gtk_widget_get_window (widget); + gdk_window_get_origin (window, x, y); + + *x += widget_alloc.x; + *y += widget_alloc.y; + + screen = gtk_widget_get_screen (widget); + monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y); + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + + /* put the menu on the left if we can't put it on the right */ + if (*x + menu_req.width > monitor.x + monitor.width) + *x -= menu_req.width - widget_alloc.width; + /* and push it back in if all else failed */ + if (*x < monitor.x) + *x = monitor.x; + + /* put the menu above if we can't put it below */ + if (*y + widget_alloc.height + menu_req.height > monitor.y + monitor.height) + *y -= menu_req.height; + else + *y += widget_alloc.height; +} +#endif + static gboolean sn_item_button_press_event (GtkWidget *widget, GdkEventButton *event) @@ -208,10 +251,16 @@ sn_item_button_press_event (GtkWidget { if (priv->menu != NULL) { +#if GTK_CHECK_VERSION (3, 22, 0) gtk_menu_popup_at_widget (priv->menu, widget, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, (GdkEvent *) event); +#else + gtk_menu_popup (priv->menu, NULL, NULL, + sn_item_popup_menu_position_func, widget, + event->button, event->time); +#endif /*Fix positioning if size changed since last shown*/ gtk_menu_reposition(priv->menu); } @@ -240,10 +289,26 @@ sn_item_popup_menu (GtkWidget *widget) if (priv->menu != NULL) { +#if GTK_CHECK_VERSION (3, 22, 0) gtk_menu_popup_at_widget (priv->menu, widget, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL); +#else + unsigned int button = 0; + guint32 active_time = GDK_CURRENT_TIME; + GdkEvent *event = gtk_get_current_event (); + + if (event) + { + gdk_event_get_button (event, &button); + active_time = gdk_event_get_time (event); + } + + gtk_menu_popup (priv->menu, NULL, NULL, + sn_item_popup_menu_position_func, widget, + button, active_time); +#endif /*Fix positioning if size changed since last shown*/ gtk_menu_reposition(priv->menu); } --- a/applets/wncklet/wncklet.c +++ b/applets/wncklet/wncklet.c @@ -49,8 +49,12 @@ void wncklet_display_help(GtkWidget* wid uri = g_strdup_printf("help:%s/%s", doc_id, link_id); else uri = g_strdup_printf("help:%s", doc_id); - +#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, uri, gtk_get_current_event_time (), &error); +#else + gtk_show_uri (gtk_widget_get_screen (widget), uri, + gtk_get_current_event_time (), &error); +#endif g_free(uri); if (error && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) --- a/configure.ac +++ b/configure.ac @@ -56,13 +56,13 @@ LT_LIB_M LIBMATE_DESKTOP_REQUIRED=1.17.0 GDK_PIXBUF_REQUIRED=2.7.1 PANGO_REQUIRED=1.15.4 -GLIB_REQUIRED=2.50.0 +GLIB_REQUIRED=2.48.0 LIBMATE_MENU_REQUIRED=1.10.0 CAIRO_REQUIRED=1.0.0 DBUS_GLIB_REQUIRED=0.80 DCONF_REQUIRED=0.13.4 LIBRSVG_REQUIRED=2.36.2 -GTK_REQUIRED=3.22.0 +GTK_REQUIRED=3.20.0 LIBWNCK_REQUIRED=3.4.6 WEATHER_REQUIRED=1.17.0 --- a/mate-panel/libpanel-util/panel-show.c +++ b/mate-panel/libpanel-util/panel-show.c @@ -178,7 +178,11 @@ gboolean panel_show_uri(GdkScreen* scree return panel_show_caja_search_uri(screen, uri, timestamp, error); } +#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, uri,timestamp, &local_error); +#else + gtk_show_uri (screen, uri, timestamp, &local_error); +#endif return _panel_show_handle_error(uri, screen, local_error, error); } @@ -283,7 +287,11 @@ panel_show_help (GdkScreen *screen, else uri = g_strdup_printf ("help:%s", doc); +#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, uri, gtk_get_current_event_time (), &local_error); +#else + gtk_show_uri (screen, uri, gtk_get_current_event_time (), &local_error); +#endif g_free (uri); return _panel_show_help_handle_error (doc, screen, local_error, error); --- a/mate-panel/panel-multiscreen.c +++ b/mate-panel/panel-multiscreen.c @@ -89,7 +89,11 @@ panel_multiscreen_get_randr_monitors_for { #ifdef HAVE_RANDR GdkDisplay *display; +#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor; +#else + int monitor_num; +#endif Display *xdisplay; Window xroot; XRRScreenResources *resources; @@ -142,10 +146,17 @@ panel_multiscreen_get_randr_monitors_for primary = XRRGetOutputPrimary (xdisplay, xroot); display = gdk_screen_get_display (screen); +#if GTK_CHECK_VERSION (3, 22, 0) monitor = gdk_display_get_primary_monitor (display); /* Use scale factor to bring geometries down to device pixels to support HiDPI displays */ scale = gdk_monitor_get_scale_factor (monitor); +#else + monitor_num = gdk_screen_get_primary_monitor (screen); + + /* Use scale factor to bring geometries down to device pixels to support HiDPI displays */ + scale = gdk_screen_get_monitor_scale_factor (screen, monitor_num); +#endif geometries = g_array_sized_new (FALSE, FALSE, sizeof (GdkRectangle), @@ -216,11 +227,19 @@ panel_multiscreen_get_gdk_monitors_for_s int i; display = gdk_screen_get_display (screen); +#if GTK_CHECK_VERSION (3, 22, 0) num_monitors = gdk_display_get_n_monitors (display); +#else + num_monitors = gdk_screen_get_n_monitors (screen); +#endif geometries = g_new (GdkRectangle, num_monitors); for (i = 0; i < num_monitors; i++) +#if GTK_CHECK_VERSION (3, 22, 0) gdk_monitor_get_geometry (gdk_display_get_monitor (display, i), &(geometries[i])); +#else + gdk_screen_get_monitor_geometry (screen, i, &(geometries[i])); +#endif *monitors_ret = num_monitors; *geometries_ret = geometries; --- a/mate-panel/xstuff.c +++ b/mate-panel/xstuff.c @@ -335,7 +335,11 @@ xstuff_zoom_animate (GtkWidget *widget, GdkScreen *gscreen; GdkRectangle rect, dest; GtkAllocation allocation; +#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor; +#else + int monitor_num; +#endif GdkDisplay *display; if (opt_rect) @@ -359,10 +363,16 @@ xstuff_zoom_animate (GtkWidget *widget, rect.width, rect.height, pixbuf, orientation); else { +#if GTK_CHECK_VERSION (3, 22, 0) display = gdk_screen_get_display (gscreen); monitor = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (widget)); gdk_monitor_get_geometry (monitor, &dest); +#else + monitor_num = gdk_screen_get_monitor_at_window (gscreen, + gtk_widget_get_window (widget)); + gdk_screen_get_monitor_geometry (gscreen, monitor_num, &dest); +#endif draw_zoom_animation (gscreen, rect.x, rect.y, rect.width, rect.height,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor