XGetWindowAttributes to get the cursor?
Lucien Gentis
lucien.gentis at univ-lorraine.fr
Sat Nov 21 12:19:31 UTC 2020
Effectively, if your 3rd party app defines a custom pixmap cursor whose
ID is not a constant, you cannot retrieve it.
Or perhaps if you test this cursor comparing it with all constant values
enumerated in cursorfont.h, if it does not correspond with any of these,
it could be your 3rd party app window.
Sorry, but I can't help you more.
Lucien
Le 20/11/2020 à 19:22, Ivan Svirid a écrit :
> The whole point is a random 3rd party app makes a custom pixmap
> cursor, and I was wondering if there is a call to retrieve
> the cursor the 3rd party window I have no control over has defined.
> With the intention to get the XImage backing it
> and copy the pixels.
>
> On Fri, Nov 20, 2020 at 1:11 PM Lucien Gentis
> <lucien.gentis at univ-lorraine.fr
> <mailto:lucien.gentis at univ-lorraine.fr>> wrote:
>
> Don't you know the ID of your custom pixmap cursors ?
>
> If you do, you can add them to the cases of the switch.
>
> Le 20/11/2020 à 15:22, Ivan Svirid a écrit :
>> Yea but this does not work with custom pixmap cursors that are
>> not part of the system cursor theme.
>>
>> On Fri, Nov 20, 2020 at 7:05 AM Lucien Gentis
>> <lucien.gentis at univ-lorraine.fr
>> <mailto:lucien.gentis at univ-lorraine.fr>> wrote:
>>
>> In fact, cursor id are defined in cursorfont.h like
>> XC_top_left_corner, XC_double_arrow,...
>>
>> Le 20/11/2020 à 12:42, Lucien Gentis a écrit :
>>>
>>> You can write a function which uses XTestCompareCursor in a
>>> switch which tests known cursor id (top_left_corner,
>>> h_double_arrow,...)|
>>> |
>>>
>>> Le 19/11/2020 à 19:59, Ivan Svirid a écrit :
>>>> Yea but this only returns true/false it does not return the
>>>> cursor_id.
>>>>
>>>> On Thu, Nov 19, 2020 at 10:26 AM Lucien Gentis
>>>> <lucien.gentis at univ-lorraine.fr
>>>> <mailto:lucien.gentis at univ-lorraine.fr>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> Perhaps you should look at XTest extension :
>>>> https://www.x.org/releases/X11R7.7/doc/xextproto/xtest.html
>>>> <https://www.x.org/releases/X11R7.7/doc/xextproto/xtest.html>
>>>>
>>>> See |XTestCompareCursor function
>>>> |
>>>>
>>>> Le 04/11/2020 à 19:25, Ivan Svirid a écrit :
>>>>> So XSetWindowAttributes allows you to set the cursor
>>>>> on the window, basically this is the hardware cursor
>>>>> when your mouse enters the window that is displayed.
>>>>>
>>>>> Is there a way to readback this value from an existing
>>>>> window? Or perhaps another workaround to get the
>>>>> cursor on a specific window?
>>>>>
>>>>> I am aware there is XFixesSelectCursorInput but this
>>>>> listens for changes and grabs the current system
>>>>> cursor; not on a per window basis.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> xorg at lists.x.org <mailto:xorg at lists.x.org>: X.Org support
>>>>> Archives:http://lists.freedesktop.org/archives/xorg <http://lists.freedesktop.org/archives/xorg>
>>>>> Info:https://lists.x.org/mailman/listinfo/xorg <https://lists.x.org/mailman/listinfo/xorg>
>>>>> Your subscription address: %(user_address)s
>>>>
>>>
>>> _______________________________________________
>>> xorg at lists.x.org <mailto:xorg at lists.x.org>: X.Org support
>>> Archives:http://lists.freedesktop.org/archives/xorg <http://lists.freedesktop.org/archives/xorg>
>>> Info:https://lists.x.org/mailman/listinfo/xorg <https://lists.x.org/mailman/listinfo/xorg>
>>> Your subscription address: %(user_address)s
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg/attachments/20201121/94effdf5/attachment.htm>
More information about the xorg
mailing list