diff options
author | Sorokin Alexei <[email protected]> | 2016-06-16 18:09:25 +0300 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-06-29 18:42:12 +0200 |
commit | 225702b3c6a609065465c66f0f2739fc1d2184a9 (patch) | |
tree | 08c677b952074a8a79b93c9d895950bdbd85799d | |
parent | de1be3467a6ff1b350fc286025364650c8d51d1e (diff) | |
download | mate-panel-225702b3c6a609065465c66f0f2739fc1d2184a9.tar.bz2 mate-panel-225702b3c6a609065465c66f0f2739fc1d2184a9.tar.xz |
fix some warnings and deprecations
-rw-r--r-- | applets/wncklet/window-list.c | 17 | ||||
-rw-r--r-- | libmate-panel-applet/mate-panel-applet.c | 7 | ||||
-rw-r--r-- | mate-panel/applet.c | 11 | ||||
-rw-r--r-- | mate-panel/menu.c | 9 | ||||
-rw-r--r-- | mate-panel/panel-applet-frame.c | 11 | ||||
-rw-r--r-- | mate-panel/panel-context-menu.c | 18 | ||||
-rw-r--r-- | mate-panel/panel-force-quit.c | 24 | ||||
-rw-r--r-- | mate-panel/panel-toplevel.c | 47 | ||||
-rw-r--r-- | mate-panel/panel-widget.c | 57 |
9 files changed, 143 insertions, 58 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c index f7fa1390..0a7a6d19 100644 --- a/applets/wncklet/window-list.c +++ b/applets/wncklet/window-list.c @@ -332,24 +332,13 @@ static void setup_gsettings(TasklistData* tasklist) tasklist); } -#if GTK_CHECK_VERSION (3, 0, 0) static void applet_size_allocate(GtkWidget *widget, GtkAllocation *allocation, TasklistData *tasklist) -#else -static void applet_size_request(GtkWidget* widget, GtkRequisition* requisition, TasklistData* tasklist) -#endif { int len; const int* size_hints; -#if GTK_CHECK_VERSION (3, 0, 0) - size_hints = wnck_tasklist_get_size_hint_list (WNCK_TASKLIST (tasklist->tasklist), &len); -#else - GtkRequisition child_req; - WnckTasklist* wncktl = WNCK_TASKLIST(tasklist->tasklist); - gtk_widget_get_child_requisition(tasklist->applet, &child_req); + size_hints = wnck_tasklist_get_size_hint_list (WNCK_TASKLIST (tasklist->tasklist), &len); - size_hints = wnck_tasklist_get_size_hint_list(wncktl, &len); -#endif g_assert(len % 2 == 0); mate_panel_applet_set_size_hints(MATE_PANEL_APPLET(tasklist->applet), size_hints, len, 0); @@ -457,11 +446,7 @@ gboolean window_list_applet_fill(MatePanelApplet* applet) g_signal_connect(G_OBJECT(tasklist->tasklist), "destroy", G_CALLBACK(destroy_tasklist), tasklist); -#if GTK_CHECK_VERSION (3, 0, 0) g_signal_connect(G_OBJECT(tasklist->applet), "size_allocate", G_CALLBACK(applet_size_allocate), tasklist); -#else - g_signal_connect(G_OBJECT(tasklist->applet), "size_request", G_CALLBACK(applet_size_request), tasklist); -#endif tasklist_update(tasklist); gtk_widget_show(tasklist->tasklist); diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c index 9c0cfc13..8fdfe275 100644 --- a/libmate-panel-applet/mate-panel-applet.c +++ b/libmate-panel-applet/mate-panel-applet.c @@ -817,9 +817,12 @@ mate_panel_applet_position_menu (GtkMenu *menu, #endif gdk_window_get_origin (gtk_widget_get_window (widget), &menu_x, &menu_y); -#if GTK_CHECK_VERSION (3, 0, 0) +#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, &pointer_x, &pointer_y, NULL); +#elif GTK_CHECK_VERSION (3, 0, 0) 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, &pointer_x, &pointer_y, NULL); + gdk_window_get_device_position (gtk_widget_get_window (widget), device, &pointer_x, &pointer_y, NULL); #else gtk_widget_get_pointer (widget, &pointer_x, &pointer_y); #endif diff --git a/mate-panel/applet.c b/mate-panel/applet.c index c7115379..c8b1c95b 100644 --- a/mate-panel/applet.c +++ b/mate-panel/applet.c @@ -520,8 +520,8 @@ mate_panel_applet_create_menu (AppletInfo *info) } menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Remove From Panel")); - image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("list-remove", + GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_signal_connect (menuitem, "activate", @@ -635,9 +635,12 @@ mate_panel_applet_position_menu (GtkMenu *menu, #endif gdk_window_get_origin (gtk_widget_get_window (applet), &menu_x, &menu_y); -#if GTK_CHECK_VERSION (3, 0, 0) +#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) 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); + 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 diff --git a/mate-panel/menu.c b/mate-panel/menu.c index 1a80fb02..053c077b 100644 --- a/mate-panel/menu.c +++ b/mate-panel/menu.c @@ -685,16 +685,25 @@ drag_end_menu_cb (GtkWidget *widget, GdkDragContext *context) GdkDisplay *display; GdkDevice *pointer; GdkDevice *keyboard; +#if GTK_CHECK_VERSION(3, 20, 0) + GdkSeat *seat; +#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); + pointer = gdk_seat_get_pointer (seat); +#else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); +#endif keyboard = gdk_device_get_associated_device (pointer); /* FIXMEgpoo: Not sure if report to GDK_OWNERSHIP_WINDOW diff --git a/mate-panel/panel-applet-frame.c b/mate-panel/panel-applet-frame.c index ddd28906..d60cd38d 100644 --- a/mate-panel/panel-applet-frame.c +++ b/mate-panel/panel-applet-frame.c @@ -489,8 +489,12 @@ mate_panel_applet_frame_button_changed (GtkWidget *widget, #if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; GdkDevice *pointer; +#if GTK_CHECK_VERSION (3, 20, 0) + GdkSeat *seat; +#else GdkDeviceManager *device_manager; #endif +#endif frame = MATE_PANEL_APPLET_FRAME (widget); @@ -519,7 +523,12 @@ mate_panel_applet_frame_button_changed (GtkWidget *widget, case 3: if (event->type == GDK_BUTTON_PRESS || event->type == GDK_2BUTTON_PRESS) { -#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION(3, 20, 0) + display = gtk_widget_get_display (widget); + seat = gdk_display_get_default_seat (display); + pointer = gdk_seat_get_pointer (seat); + gdk_device_ungrab (pointer, GDK_CURRENT_TIME); +#elif GTK_CHECK_VERSION (3, 0, 0) display = gtk_widget_get_display (widget); device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); diff --git a/mate-panel/panel-context-menu.c b/mate-panel/panel-context-menu.c index b44ce112..efda10cd 100644 --- a/mate-panel/panel-context-menu.c +++ b/mate-panel/panel-context-menu.c @@ -214,7 +214,7 @@ panel_context_menu_build_edition (PanelWidget *panel_widget, GtkWidget *image; menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Add to Panel...")); - image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("list-add", GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); @@ -225,8 +225,8 @@ panel_context_menu_build_edition (PanelWidget *panel_widget, gtk_widget_set_sensitive (menuitem, FALSE); menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Properties")); - image = gtk_image_new_from_stock (GTK_STOCK_PROPERTIES, - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("document-properties", + GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); @@ -235,8 +235,8 @@ panel_context_menu_build_edition (PanelWidget *panel_widget, panel_widget->toplevel); menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Delete This Panel")); - image = gtk_image_new_from_stock (GTK_STOCK_DELETE, - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("edit-delete", + GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); @@ -250,7 +250,7 @@ panel_context_menu_build_edition (PanelWidget *panel_widget, add_menu_separator (menu); menuitem = gtk_image_menu_item_new_with_mnemonic (_("_New Panel")); - image = gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("document-new", GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); @@ -294,7 +294,7 @@ panel_context_menu_create (PanelWidget *panel) panel_context_menu_build_edition (panel, retval); menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Help")); - image = gtk_image_new_from_stock (GTK_STOCK_HELP, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("help-browser", GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (retval), menuitem); @@ -302,8 +302,8 @@ panel_context_menu_create (PanelWidget *panel) G_CALLBACK (panel_context_menu_show_help), NULL); menuitem = gtk_image_menu_item_new_with_mnemonic (_("A_bout Panels")); - image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("help-about", + GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (retval), menuitem); diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c index 842922b2..ac7611a3 100644 --- a/mate-panel/panel-force-quit.c +++ b/mate-panel/panel-force-quit.c @@ -116,8 +116,12 @@ remove_popup (GtkWidget *popup) GdkDisplay *display; GdkDevice *pointer; GdkDevice *keyboard; +#if GTK_CHECK_VERSION (3, 20, 0) + GdkSeat *seat; +#else GdkDeviceManager *device_manager; #endif +#endif root = gdk_screen_get_root_window ( gtk_window_get_screen (GTK_WINDOW (popup))); @@ -127,8 +131,13 @@ remove_popup (GtkWidget *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); + pointer = gdk_seat_get_pointer (seat); +#else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); +#endif keyboard = gdk_device_get_associated_device (pointer); gdk_device_ungrab (pointer, GDK_CURRENT_TIME); @@ -339,11 +348,15 @@ panel_force_quit (GdkScreen *screen, GtkWidget *popup; GdkWindow *root; #if GTK_CHECK_VERSION (3, 0, 0) - GdkDisplay *display; - GdkDevice *pointer; - GdkDevice *keyboard; + GdkDisplay *display; + GdkDevice *pointer; + GdkDevice *keyboard; +#if GTK_CHECK_VERSION (3, 20, 0) + GdkSeat *seat; +#else GdkDeviceManager *device_manager; #endif +#endif popup = display_popup_window (screen); @@ -354,8 +367,13 @@ panel_force_quit (GdkScreen *screen, 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); + pointer = gdk_seat_get_pointer (seat); +#else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); +#endif keyboard = gdk_device_get_associated_device (pointer); status = gdk_device_grab (pointer, root, diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c index 084d0684..749e04df 100644 --- a/mate-panel/panel-toplevel.c +++ b/mate-panel/panel-toplevel.c @@ -442,8 +442,12 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp GdkDisplay *display; GdkDevice *pointer; GdkDevice *keyboard; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkSeat *seat; +#else GdkDeviceManager *device_manager; #endif +#endif if (toplevel->priv->state != PANEL_STATE_NORMAL || toplevel->priv->grab_op != PANEL_GRAB_OP_NONE) @@ -501,8 +505,13 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp 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); + pointer = gdk_seat_get_pointer (seat); +#else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); +#endif keyboard = gdk_device_get_associated_device (pointer); gdk_device_grab (pointer, window, @@ -537,8 +546,12 @@ static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_) GdkDisplay *display; GdkDevice *pointer; GdkDevice *keyboard; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkSeat *seat; +#else GdkDeviceManager *device_manager; #endif +#endif g_return_if_fail (toplevel->priv->grab_op != PANEL_GRAB_OP_NONE); @@ -551,8 +564,13 @@ static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_) #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); + pointer = gdk_seat_get_pointer (seat); +#else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); +#endif keyboard = gdk_device_get_associated_device (pointer); gdk_device_ungrab (pointer, time_); @@ -866,10 +884,12 @@ static gboolean panel_toplevel_warp_pointer_increment(PanelToplevel* toplevel, i screen = gtk_window_get_screen (GTK_WINDOW (toplevel)); root_window = gdk_screen_get_root_window (screen); - -#if GTK_CHECK_VERSION (3, 0, 0) +#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) 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); + 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 @@ -1377,14 +1397,20 @@ static gboolean panel_toplevel_contains_pointer(PanelToplevel* toplevel) GdkDisplay *display; GdkScreen *screen; GtkWidget *widget; -#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION(3, 20, 0) + GdkSeat *seat; + GdkDevice *pointer; +#elif GTK_CHECK_VERSION (3, 0, 0) GdkDeviceManager *device_manager; GdkDevice *pointer; #endif int x, y; display = gdk_display_get_default (); -#if GTK_CHECK_VERSION (3, 0, 0) +#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) device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); #endif @@ -1569,9 +1595,7 @@ void panel_toplevel_update_edges(PanelToplevel* toplevel) height = toplevel->priv->geometry.height; edges = PANEL_EDGE_NONE; -#if GTK_CHECK_VERSION (3, 18, 0) - background = &toplevel->background; -#else +#if !GTK_CHECK_VERSION (3, 0, 0) background = &toplevel->priv->panel_widget->background; #endif @@ -3137,7 +3161,6 @@ panel_toplevel_realize (GtkWidget *widget) GdkScreen *screen; GdkVisual *visual; GdkWindow *window; - GdkGeometry geometry; toplevel = PANEL_TOPLEVEL (widget); @@ -3529,7 +3552,7 @@ static gboolean panel_toplevel_expose(GtkWidget* widget, GdkEventExpose* event) #if GTK_CHECK_VERSION (3, 0, 0) x = 0; y = 0; - height = height; + height = aheight; #else int xthickness, ythickness; x = allocation.x; @@ -3759,7 +3782,7 @@ panel_toplevel_button_release_event (GtkWidget *widget, return TRUE; } #if GTK_CHECK_VERSION (3, 18, 0) -static void +static gboolean panel_toplevel_configure_event (GtkWidget *widget, GdkEventConfigure *event) { @@ -3769,7 +3792,7 @@ panel_toplevel_configure_event (GtkWidget *widget, set_background_region (toplevel); - return; + return TRUE; } #endif diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c index b77fa1af..b040fb5a 100644 --- a/mate-panel/panel-widget.c +++ b/mate-panel/panel-widget.c @@ -1683,7 +1683,10 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap) !gtk_widget_get_visible(widget)) return FALSE; -#if GTK_CHECK_VERSION(3, 0, 0) +#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) 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 @@ -2085,16 +2088,25 @@ panel_widget_applet_drag_start (PanelWidget *panel, #if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; GdkDevice *pointer; +#if GTK_CHECK_VERSION(3, 20, 0) + GdkSeat *seat; +#else 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); + pointer = gdk_seat_get_pointer (seat); +#else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); +#endif status = gdk_device_grab (pointer, window, GDK_OWNERSHIP_NONE, FALSE, APPLET_EVENT_MASK, @@ -2120,7 +2132,11 @@ panel_widget_applet_drag_start (PanelWidget *panel, void panel_widget_applet_drag_end (PanelWidget *panel) { -#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION(3, 20, 0) + GdkDisplay *display; + GdkDevice *pointer; + GdkSeat *seat; +#elif GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; GdkDevice *pointer; GdkDeviceManager *device_manager; @@ -2130,7 +2146,13 @@ panel_widget_applet_drag_end (PanelWidget *panel) if (panel->currently_dragged_applet == NULL) return; -#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION(3, 20, 0) + display = gtk_widget_get_display (GTK_WIDGET (panel)); + seat = gdk_display_get_default_seat (display); + pointer = gdk_seat_get_pointer (seat); + + gdk_device_ungrab (pointer, GDK_CURRENT_TIME); +#elif GTK_CHECK_VERSION (3, 0, 0) 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); @@ -2157,7 +2179,10 @@ panel_widget_get_cursorloc (PanelWidget *panel) g_return_val_if_fail (PANEL_IS_WIDGET (panel), -1); -#if GTK_CHECK_VERSION (3, 0, 0) +#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) 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 @@ -2387,12 +2412,15 @@ panel_widget_applet_move_to_cursor (PanelWidget *panel) } } -#if GTK_CHECK_VERSION (3, 0, 0) - 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); +#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) + 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); + gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET(panel)), + NULL, NULL, &mods); #endif movement = PANEL_SWITCH_MOVE; @@ -2449,7 +2477,10 @@ move_timeout_handler(gpointer data) widget = panel->currently_dragged_applet->applet; -#if GTK_CHECK_VERSION (3, 0, 0) +#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) 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 @@ -2892,7 +2923,11 @@ panel_widget_reparent (PanelWidget *old_panel, panel_widget_reset_saved_focus (old_panel); if (gtk_container_get_focus_child (GTK_CONTAINER (old_panel)) == applet) focus_widget = gtk_window_get_focus (GTK_WINDOW (old_panel->toplevel)); - gtk_widget_reparent (applet, GTK_WIDGET (new_panel)); + + g_object_ref (applet); + gtk_container_remove (GTK_CONTAINER (old_panel), applet); + gtk_container_add (GTK_CONTAINER (new_panel), applet); + g_object_unref (applet); if (info && info->type == PANEL_OBJECT_APPLET) mate_panel_applet_frame_set_panel (MATE_PANEL_APPLET_FRAME (ad->applet), new_panel); |