mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-03-12 20:58:17 +03:00
Avoid use of deprecated GTK3 pointer APIs
The gtk_widget_get_pointer() API is deprecated in GTK3 since it is not aware of multiple pointers. Replace its usage in autoDrawer.c with GdkDeviceManager and friends Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
20c2703a77
commit
163b685332
@ -215,11 +215,22 @@ ViewAutoDrawerUpdate(ViewAutoDrawer *that, // IN
|
||||
|
||||
/* Is the mouse cursor inside the event box? */
|
||||
|
||||
{
|
||||
if (gtk_widget_get_window(priv->evBox)) {
|
||||
int x;
|
||||
int y;
|
||||
#if GTK_CHECK_VERSION(3, 0, 0)
|
||||
GdkDevice *dev;
|
||||
GdkDeviceManager *devmgr;
|
||||
|
||||
devmgr = gdk_display_get_device_manager(gtk_widget_get_display(priv->evBox));
|
||||
dev = gdk_device_manager_get_client_pointer(devmgr);
|
||||
|
||||
gdk_window_get_device_position(gtk_widget_get_window(priv->evBox),
|
||||
dev, &x, &y, NULL);
|
||||
#else
|
||||
gtk_widget_get_pointer(priv->evBox, &x, &y);
|
||||
#endif
|
||||
|
||||
gtk_widget_get_allocation(priv->evBox, &allocation);
|
||||
g_assert(gtk_container_get_border_width( GTK_CONTAINER(priv->evBox))
|
||||
== 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user