Re: Problems with querying the pointer



On Mon, 30 Sep 2002, Owen Taylor wrote:

> I frankly don't see any remotely reasonable way to fix this, so
> I think what we need to do is just say that 
> gdk_window_set_pointer_hooks() is a non-multihead safe API, and
> augment it with a new multihead-aware API. My proposal for this
> is:
>  
> struct _GdkDisplayPointerHooks 
> {
>   void (*get_pointer)              (GdkDisplay	    *display,
>                                     GdkWindow      **root_window,
> 			            gint	    *x,
> 			            gint   	    *y,
> 			            GdkModifierType *mask);
>   GdkWindow* (*window_get_pointer) (GdkDisplay      *display,
>                                     GdkWindow	    *window,
> 			            gint	    *x,
> 			            gint   	    *y,
> 			            GdkModifierType *mask);
>   GdkWindow* (*window_at_pointer)  (GdkDisplay      *display,
>                                     gint            *win_x,
>                                     gint            *win_y);
> };
> 
> GdkPointerHooks *gdk_display_set_pointer_hooks (GdkDisplay            *display,
>                                                 const GdkPointerHooks *new_hooks);
> void             gdk_display_get_pointer     (GdkDisplay      *display,
>                                               GdkWindow      **root_window,
>         			              gint	      *x,
>         			              gint 	      *y,
> 			                      GdkModifierType *mask);
> GdkWindow *      gdk_display_get_window_at_pointer (GdkDisplay      *display,
>         			                    gint	    *win_x,
>         			                    gint 	    *win_y);
> 
> And remove gdk_screen_get_window_at_pointer().
> 
> gdk_set_pointer_hooks() would set the GdkDisplayPointerHooks for the default 
> display to a thunk set of pointer hooks that would work for the single-screen,
> single-display case.

for event recording you need to hook into all XQueryPointer() calls, so why
will you want to set pointer hooks per-display? i.e. introducing a new
GdkDisplayPointerHooks is fine (the old API needs to be deprecated then
btw) but should be set only once and globally, not per display.

> 
> Regards,
>                                         Owen
> 
> (*) The question would remain whether we should:
> 
>   a) Change gdk_screen_get_window_at_Pointer() to 
>      gdk_display_get_window_at_pointer(), and leave a mismatch
>      between this and GdkPointerHooks.

well, you'll have to keep gdk_screen_get_window_at_pointer() for binary
compat anyway, so this and GdkPointerHooks will simply be deprecated and
gdk_display_get_window_at_pointer() matches GdkDisplayPointerHooks.

>   b) Keep the match and expose the oddity
>      (gdk_screen_get_window_at_pointer() can return a window
>      on a different screen) in a more common API.
>   
>     It would still be messy.

---
ciaoTJ




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]