[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: XGetWindowAttributes to get the cursor?
From:       Ivan Svirid <vans554 () gmail ! com>
Date:       2020-11-21 14:13:30
Message-ID: CAG-EYCiVxi=dEVFynVJiKYtKPQnrcVa2Uq=W4L9i3Po8vFj1WQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


"Effectively, if your 3rd party app defines a custom pixmap cursor whose ID
is not a constant, you cannot retrieve it.

Yea I know thats why I asked on the mailing list this question haha.

Thanks I guess..

On Sat, Nov 21, 2020 at 7:19 AM Lucien Gentis <
lucien.gentis@univ-lorraine.fr> wrote:

> Effectively, if your 3rd party app defines a custom pixmap cursor whose I=
D
> 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 =C3=A0 19:22, Ivan Svirid a =C3=A9crit :
>
> 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@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 =C3=A0 15:22, Ivan Svirid a =C3=A9crit :
>>
>> 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@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 =C3=A0 12:42, Lucien Gentis a =C3=A9crit :
>>>
>>> You can write a function which uses XTestCompareCursor in a switch whic=
h
>>> tests known cursor id (top_left_corner, h_double_arrow,...)
>>> Le 19/11/2020 =C3=A0 19:59, Ivan Svirid a =C3=A9crit :
>>>
>>> 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@univ-lorraine.fr> wrote:
>>>
>>>> Hello,
>>>>
>>>> Perhaps you should look at XTest extension :
>>>> https://www.x.org/releases/X11R7.7/doc/xextproto/xtest.html
>>>>
>>>> See XTestCompareCursor function
>>>> Le 04/11/2020 =C3=A0 19:25, Ivan Svirid a =C3=A9crit :
>>>>
>>>> So XSetWindowAttributes allows you to set the cursor on the window,
>>>> basically this is the hardware cursor when your mouse enters the windo=
w
>>>> 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@lists.x.org: X.Org=
 support
>>>> Archives: http://lists.freedesktop.org/archives/xorg
>>>> Info: https://lists.x.org/mailman/listinfo/xorg
>>>> Your subscription address: %(user_address)s
>>>>
>>>>
>>> _______________________________________________xorg@lists.x.org: X.Org =
support
>>> Archives: http://lists.freedesktop.org/archives/xorg
>>> Info: https://lists.x.org/mailman/listinfo/xorg
>>> Your subscription address: %(user_address)s
>>>
>>>

[Attachment #5 (text/html)]

<div dir="ltr">&quot;Effectively, if your 3rd party app defines a custom pixmap \
cursor whose ID is not a constant, you cannot retrieve it.<br><br>Yea I know thats \
why I asked on the mailing list this question haha.<br><br>Thanks I \
guess..</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, \
Nov 21, 2020 at 7:19 AM Lucien Gentis &lt;<a \
href="mailto:lucien.gentis@univ-lorraine.fr">lucien.gentis@univ-lorraine.fr</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  
    
  
  <div>
    <p>Effectively, if your 3rd party app defines a custom pixmap cursor
      whose ID is not a constant, you cannot retrieve it.</p>
    <p>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.</p>
    <p>Sorry, but I can&#39;t help you more.</p>
    <p>Lucien<br>
    </p>
    <div>Le 20/11/2020 Ã  19:22, Ivan Svirid a
      écrit  :<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">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  
        <div>the cursor the 3rd party window I have no control over has
          defined. With the intention to get the XImage backing it<br>
          and copy the pixels.<br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020 at 1:11
          PM Lucien Gentis &lt;<a href="mailto:lucien.gentis@univ-lorraine.fr" \
target="_blank">lucien.gentis@univ-lorraine.fr</a>&gt;  wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  <div>
            <p>Don&#39;t you know the ID of your custom pixmap cursors ?</p>
            <p>If you do, you can add them to the cases of the switch.<br>
            </p>
            <div>Le 20/11/2020 à 15:22, Ivan Svirid a écrit  :<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Yea but this does not work with custom
                pixmap cursors that are not part of the system cursor
                theme.</div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020
                  at 7:05 AM Lucien Gentis &lt;<a \
href="mailto:lucien.gentis@univ-lorraine.fr" \
target="_blank">lucien.gentis@univ-lorraine.fr</a>&gt;  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  <div>
                    <p>In fact, cursor id are defined in cursorfont.h
                      like XC_top_left_corner, XC_double_arrow,...</p>
                    <div>Le 20/11/2020 à 12:42, Lucien Gentis a écrit  :<br>
                    </div>
                    <blockquote type="cite">
                      <p>You can write a function which uses
                        XTestCompareCursor in a switch which tests known
                        cursor id (top_left_corner, h_double_arrow,...)<code><br>
                        </code></p>
                      <div>Le 19/11/2020 à 19:59, Ivan Svirid a écrit  :<br>
                      </div>
                      <blockquote type="cite">
                        <div dir="ltr">Yea but this only returns
                          true/false it does not return the cursor_id.</div>
                        <br>
                        <div class="gmail_quote">
                          <div dir="ltr" class="gmail_attr">On Thu, Nov
                            19, 2020 at 10:26 AM Lucien Gentis &lt;<a \
href="mailto:lucien.gentis@univ-lorraine.fr" \
target="_blank">lucien.gentis@univ-lorraine.fr</a>&gt;  wrote:<br>
                          </div>
                          <blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  <div>
                              <p>Hello,</p>
                              <p>Perhaps you should look at XTest
                                extension : <a \
href="https://www.x.org/releases/X11R7.7/doc/xextproto/xtest.html" \
target="_blank">https://www.x.org/releases/X11R7.7/doc/xextproto/xtest.html</a></p>  \
<p>See <code>XTestCompareCursor function<br>  </code></p>
                              <div>Le 04/11/2020 Ã  19:25, Ivan Svirid a
                                écrit  :<br>
                              </div>
                              <blockquote type="cite">
                                <div dir="ltr">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.    <br>
                                  <br>
                                  Is there a way to readback this value
                                  from an existing window? Or perhaps
                                  another workaround to get the cursor
                                  on a specific window?<br>
                                  <br>
                                  I am aware there is
                                  XFixesSelectCursorInput but this
                                  listens for changes and grabs the
                                  current system cursor; not on a per
                                  window basis.<br>
                                  <br>
                                  <br>
                                </div>
                                <br>
                                <fieldset></fieldset>
                                <pre>_______________________________________________
<a href="mailto:xorg@lists.x.org" target="_blank">xorg@lists.x.org</a>: X.Org support
Archives: <a href="http://lists.freedesktop.org/archives/xorg" \
                target="_blank">http://lists.freedesktop.org/archives/xorg</a>
Info: <a href="https://lists.x.org/mailman/listinfo/xorg" \
target="_blank">https://lists.x.org/mailman/listinfo/xorg</a> Your subscription \
address: %(user_address)s </pre>
                              </blockquote>
                            </div>
                          </blockquote>
                        </div>
                      </blockquote>
                      <br>
                      <fieldset></fieldset>
                      <pre>_______________________________________________
<a href="mailto:xorg@lists.x.org" target="_blank">xorg@lists.x.org</a>: X.Org support
Archives: <a href="http://lists.freedesktop.org/archives/xorg" \
                target="_blank">http://lists.freedesktop.org/archives/xorg</a>
Info: <a href="https://lists.x.org/mailman/listinfo/xorg" \
target="_blank">https://lists.x.org/mailman/listinfo/xorg</a> Your subscription \
address: %(user_address)s </pre>
                    </blockquote>
                  </div>
                </blockquote>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </div>

</blockquote></div>



_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic