Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1:ARM:Staging
mate-notification-daemon
mate-notification-daemon-gtk-3.20.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mate-notification-daemon-gtk-3.20.patch of Package mate-notification-daemon
--- a/configure.ac +++ b/configure.ac @@ -78,7 +78,7 @@ dnl ------------------------------------ dnl Requirements for the themes dnl --------------------------------------------------------------------------- -GTK_REQUIRED=3.22.0 +GTK_REQUIRED=3.20.0 PKG_CHECK_MODULES(THEME, gtk+-3.0 >= $GTK_REQUIRED @@ -89,7 +89,7 @@ AC_SUBST(THEME_LIBS) dnl --------------------------------------------------------------------------- dnl Requirements for the daemon dnl --------------------------------------------------------------------------- -REQ_GLIB_VERSION=2.50.0 +REQ_GLIB_VERSION=2.48.0 REQ_DBUS_VERSION=0.78 REQ_LIBCANBERRA_GTK_VERSION=0.4 PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""]) --- a/src/capplet/mate-notification-properties.c +++ b/src/capplet/mate-notification-properties.c @@ -212,8 +212,12 @@ static void notification_properties_dial // TODO: add support for mulitple screens. screen = gdk_display_get_default_screen(display); g_assert(screen != NULL); - + +#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 g_assert(num_monitors >= 1); store = gtk_list_store_new(N_COLUMNS_MONITOR, G_TYPE_INT); --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c @@ -176,6 +176,7 @@ static void remove_exit_timeout(NotifyDa daemon->priv->exit_timeout_source = 0; } +#if GTK_CHECK_VERSION(3, 22, 0) static int _gtk_get_monitor_num (GdkMonitor *monitor) { @@ -194,10 +195,17 @@ _gtk_get_monitor_num (GdkMonitor *monito } static void create_stack_for_monitor(NotifyDaemon* daemon, GdkScreen* screen, GdkMonitor *monitor_num) +#else +static void create_stack_for_monitor(NotifyDaemon *daemon, GdkScreen *screen, int monitor_num) +#endif { NotifyScreen* nscreen = daemon->priv->screen; +#if GTK_CHECK_VERSION(3, 22, 0) nscreen->stacks[_gtk_get_monitor_num(monitor_num)] = notify_stack_new(daemon, screen, monitor_num, daemon->priv->stack_location); +#else + nscreen->stacks[monitor_num] = notify_stack_new(daemon, screen, monitor_num, daemon->priv->stack_location); +#endif } static void on_screen_monitors_changed(GdkScreen* screen, NotifyDaemon* daemon) @@ -210,7 +218,11 @@ static void on_screen_monitors_changed(G nscreen = daemon->priv->screen; display = gdk_screen_get_display (screen); +#if GTK_CHECK_VERSION(3, 22, 0) n_monitors = gdk_display_get_n_monitors(display); +#else + n_monitors = gdk_screen_get_n_monitors(screen); +#endif if (n_monitors > nscreen->n_stacks) { @@ -220,7 +232,11 @@ static void on_screen_monitors_changed(G /* add more stacks */ for (i = nscreen->n_stacks; i < n_monitors; i++) { +#if GTK_CHECK_VERSION(3, 22, 0) create_stack_for_monitor(daemon, screen, gdk_display_get_monitor (display, i)); +#else + create_stack_for_monitor(daemon, screen, i); +#endif } nscreen->n_stacks = n_monitors; @@ -266,13 +282,21 @@ static void create_stacks_for_screen(Not nscreen = daemon->priv->screen; display = gdk_screen_get_display (screen); +#if GTK_CHECK_VERSION(3, 22, 0) nscreen->n_stacks = gdk_display_get_n_monitors(display); +#else + nscreen->n_stacks = gdk_screen_get_n_monitors(screen); +#endif nscreen->stacks = g_renew(NotifyStack*, nscreen->stacks, nscreen->n_stacks); for (i = 0; i < nscreen->n_stacks; i++) { +#if GTK_CHECK_VERSION(3, 22, 0) create_stack_for_monitor(daemon, screen, gdk_display_get_monitor (display, i)); +#else + create_stack_for_monitor(daemon, screen, i); +#endif } } @@ -1508,7 +1532,11 @@ gboolean notify_daemon_notify_handler(No } else { +#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor_id; +#else + int monitor_num; +#endif GdkDisplay *display; GdkSeat *seat; GdkDevice *pointer; @@ -1527,15 +1555,24 @@ gboolean notify_daemon_notify_handler(No pointer = gdk_seat_get_pointer (seat); gdk_device_get_position (pointer, &screen, &x, &y); +#if GTK_CHECK_VERSION (3, 22, 0) monitor_id = gdk_display_get_monitor_at_point (gdk_screen_get_display (screen), x, y); +#else + monitor_num = gdk_screen_get_monitor_at_point (screen, x, y); +#endif } else { screen = gdk_display_get_default_screen(gdk_display_get_default()); +#if GTK_CHECK_VERSION (3, 22, 0) monitor_id = gdk_display_get_monitor (gdk_display_get_default(), g_settings_get_int(daemon->gsettings, GSETTINGS_KEY_MONITOR_NUMBER)); +#else + monitor_num = g_settings_get_int (daemon->gsettings, GSETTINGS_KEY_MONITOR_NUMBER); +#endif } +#if GTK_CHECK_VERSION (3, 22, 0) if (_gtk_get_monitor_num (monitor_id) >= priv->screen->n_stacks) { /* screw it - dump it on the last one we'll get @@ -1544,6 +1581,16 @@ gboolean notify_daemon_notify_handler(No } notify_stack_add_window (priv->screen->stacks[_gtk_get_monitor_num (monitor_id)], nw, new_notification); +#else + if (monitor_num >= priv->screen->n_stacks) + { + /* screw it - dump it on the last one we'll get + a monitors-changed signal soon enough*/ + monitor_num = priv->screen->n_stacks - 1; + } + + notify_stack_add_window (priv->screen->stacks[monitor_num], nw, new_notification); +#endif } if (id == 0) --- a/src/daemon/stack.c +++ b/src/daemon/stack.c @@ -36,7 +36,11 @@ struct _NotifyStack { NotifyDaemon* daemon; GdkScreen* screen; +#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor; +#else + int monitor; +#endif NotifyStackLocation location; GList* windows; guint update_id; @@ -189,6 +193,7 @@ translate_coordinates (NotifyStackLocati } } +#if GTK_CHECK_VERSION (3, 22, 0) static int _gtk_get_monitor_num (GdkMonitor *monitor) { @@ -205,11 +210,16 @@ _gtk_get_monitor_num (GdkMonitor *monito return -1; } +#endif NotifyStack * notify_stack_new (NotifyDaemon *daemon, GdkScreen *screen, +#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor, +#else + int monitor, +#endif NotifyStackLocation location) { NotifyStack *stack; @@ -218,7 +228,11 @@ notify_stack_new (NotifyDaemon *da display = gdk_screen_get_display (screen); g_assert (daemon != NULL); g_assert (screen != NULL && GDK_IS_SCREEN (screen)); +#if GTK_CHECK_VERSION (3, 22, 0) g_assert ((guint)_gtk_get_monitor_num (monitor) < (guint)gdk_display_get_n_monitors (display)); +#else + g_assert (monitor < (guint) gdk_screen_get_n_monitors (screen)); +#endif g_assert (location != NOTIFY_STACK_LOCATION_UNKNOWN); stack = g_new0 (NotifyStack, 1); @@ -291,7 +305,12 @@ notify_stack_shift_notifications (Notify int n_wins; get_work_area (stack, &workarea); +#if GTK_CHECK_VERSION (3, 22, 0) gdk_monitor_get_geometry (stack->monitor, &monitor); +#else + gdk_screen_get_monitor_geometry (stack->screen, stack->monitor, + &monitor); +#endif gdk_rectangle_intersect (&monitor, &workarea, &workarea); add_padding_to_rect (&workarea); --- a/src/daemon/stack.h +++ b/src/daemon/stack.h @@ -38,7 +38,11 @@ typedef enum { typedef struct _NotifyStack NotifyStack; +#if GTK_CHECK_VERSION (3, 22, 0) NotifyStack* notify_stack_new(NotifyDaemon* daemon, GdkScreen* screen, GdkMonitor *monitor, NotifyStackLocation stack_location); +#else +NotifyStack *notify_stack_new(NotifyDaemon *daemon, GdkScreen *screen, int monitor, NotifyStackLocation stack_location); +#endif void notify_stack_destroy(NotifyStack* stack); void notify_stack_set_location(NotifyStack* stack, NotifyStackLocation location); --- a/src/themes/standard/theme.c +++ b/src/themes/standard/theme.c @@ -267,14 +267,23 @@ static GtkArrowType get_notification_arr GdkScreen* screen; GdkRectangle monitor_geometry; GdkDisplay* display; +#if GTK_CHECK_VERSION(3, 22, 0) GdkMonitor* monitor; +#else + int monitor; +#endif windata = g_object_get_data(G_OBJECT(nw), "windata"); screen = gdk_window_get_screen(GDK_WINDOW( gtk_widget_get_window(nw))); display = gdk_screen_get_display (screen); +#if GTK_CHECK_VERSION(3, 22, 0) monitor = gdk_display_get_monitor_at_point (display, windata->point_x, windata->point_y); gdk_monitor_get_geometry (monitor, &monitor_geometry); +#else + monitor = gdk_screen_get_monitor_at_point(screen, windata->point_x, windata->point_y); + gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry); +#endif if (windata->point_y - monitor_geometry.y + windata->height + DEFAULT_ARROW_HEIGHT > monitor_geometry.height) { @@ -309,7 +318,11 @@ static void create_border_with_arrow(Gtk int arrow_offset = DEFAULT_ARROW_OFFSET; GdkPoint* shape_points = NULL; int i = 0; +#if GTK_CHECK_VERSION(3, 22, 0) GdkMonitor* monitor; +#else + int monitor; +#endif GdkDisplay* display; GdkRectangle monitor_geometry; @@ -318,8 +331,13 @@ static void create_border_with_arrow(Gtk screen = gdk_window_get_screen(GDK_WINDOW(gtk_widget_get_window(nw))); display = gdk_screen_get_display (screen); +#if GTK_CHECK_VERSION(3, 22, 0) monitor = gdk_display_get_monitor_at_point (display, windata->point_x, windata->point_y); gdk_monitor_get_geometry (monitor, &monitor_geometry); +#else + monitor = gdk_screen_get_monitor_at_point(screen, windata->point_x, windata->point_y); + gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry); +#endif windata->num_border_points = 5;
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