Re: [Bug 602733] Extended Input with Xinerama
- From: Alexander Roalter <alexander roalter it>
- To: gtk-devel-list gnome org
- Subject: Re: [Bug 602733] Extended Input with Xinerama
- Date: Thu, 21 Jan 2010 00:18:21 +0100
On 11/25/2009 10:40 PM, gtk+ (bugzilla.gnome.org) wrote:
> https://bugzilla.gnome.org/show_bug.cgi?id=602733
> gtk+ | gdk | unspecified
>
> Matthias Clasen <mclasen> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |mclasen redhat com
>
> --- Comment #1 from Matthias Clasen <mclasen redhat com> 2009-11-25 21:40:52 UTC ---
> This will have to be redone against the xi2 branch which we are going to merge
> sometime soon. But I am dubious about the claims here.
>
> [...] still behaves as if the tablet weren't
> restricted to only a single screen, even though the normal cursor knows
> better
> and stays at the same screen.
>
> What is restricting the 'normal cursor' to a single screen here ? And is the
> 'normal cursor' the core pointer, or the tablet ?
>
> Finally, is your setup really two screens, or is it to monitors that form a
> single screen ?
>
Once again I submit the patch for a working tablet (extended input
support) with GTK (e.g. in Inkscape and GIMP) when using Xinerama and
Screen Mode for the Input device.
Patch was made with git diff > xinerama.diff, if there's something wrong
with that please let me know
--
Cheers,
Alex
diff --git a/gdk/x11/gdkinput-x11.c b/gdk/x11/gdkinput-x11.c
index 767b070..77f1ef0 100644
--- a/gdk/x11/gdkinput-x11.c
+++ b/gdk/x11/gdkinput-x11.c
@@ -454,11 +454,18 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
if (gdkdev->info.mode == GDK_MODE_SCREEN)
{
- x_scale = gdk_screen_get_width (gdk_drawable_get_screen (window)) / device_width;
- y_scale = gdk_screen_get_height (gdk_drawable_get_screen (window)) / device_height;
-
- x_offset = - impl_window->input_window->root_x - priv->abs_x;
- y_offset = - impl_window->input_window->root_y - priv->abs_y;
+ int core_pointer_x, core_pointer_y, cur_monitor;
+ GdkRectangle mon_geometry;
+ GdkScreen *cur_screen;
+ gdk_display_get_pointer (gdk_drawable_get_display (window), &cur_screen, &core_pointer_x, &core_pointer_y, 0);
+ cur_monitor = gdk_screen_get_monitor_at_point (cur_screen, core_pointer_x, core_pointer_y);
+
+ gdk_screen_get_monitor_geometry (cur_screen, cur_monitor, &mon_geometry);
+ x_scale = mon_geometry.width / device_width;
+ y_scale = mon_geometry.height / device_height;
+
+ x_offset = - impl_window->input_window->root_x - priv->abs_x + mon_geometry.x;
+ y_offset = - impl_window->input_window->root_y - priv->abs_y + mon_geometry.y;
}
else /* GDK_MODE_WINDOW */
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]