Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 10-30-2023, 01:36 PM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,672
Default Done-API: gfx.getchar(65536)&4 is always 4 even if window is not visible

I try to code tooltips in my gfx-window, when I hover above certain objects shown in my gfx-window.
However, the hovering is also recognized, when I switch to another app(the window is hidden by the other app), so a tooltip is shown "through the other app".

So I thought, I can use gfx.getchar(65536)&4 to only show tooltips, when the window is visible and if not, I don't show tooltips.

Now here's the problem: &4 is always 4, even if the window is hidden/behind another app. I'm not sure, whether it's intended behavior or a bug, but I could really need for this to work.

Is there a way?

I tried to circumvent it by only showing tooltips when window is focused but that's not ideal in my usecase.

Tested on Windows 7, Reaper 7.01

Edit: done in v7.03 as &8
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 11-11-2023 at 03:51 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-30-2023, 03:42 PM   #2
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,984
Default

gfx.getchar(65536)&4 works here, (Win10)
If I call this to hide the gfx window then the above code returns 0
reaper.JS_Window_Show(hwnd,"HIDE")
And returns 4 again when unhide it.
Edgemeal is offline   Reply With Quote
Old 10-30-2023, 03:45 PM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,672
Default

Hmm, by hiding you mean, switching to another app?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-30-2023, 03:57 PM   #4
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,984
Default

Docs say, &4=window is visible
Which I assumed is same as IsWindowVisible function , if true then doesn't matter if window has focus or not, or is behind some other window.
Edgemeal is offline   Reply With Quote
Old 10-31-2023, 02:58 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,672
Default

Hmm, ok, then it's not working on Windows 7.
I tried to hide the gfx-window with the IDE as well as my browser.
&4 was always 4...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-31-2023, 03:34 AM   #6
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,984
Default

Odd that its always 4, but thats not going to help solve your problem anyway.

Whats wrong with only showing tooltips when your gfx window is the foreground/focused window?

<strike>Otherwise when its not the focused window I suppose you'd have to enum all the open windows and check if the mouse is inside some other windows RECT area (that intersects with your window), and if it is then don't show/hide the tooltip. ?</strike>

EDIT No need for all that, just use JS_Window_FromPoint()?

Last edited by Edgemeal; 10-31-2023 at 01:56 PM.
Edgemeal is offline   Reply With Quote
Old 10-31-2023, 08:39 AM   #7
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,672
Default

I try to code a script that works for blind users and when I hover above a ui-element, I show a tooltip and send a message to the screenreader.
This works also for the Reaper window(like arrange view), if a child-window is currently in focus.
That way, blind users can use the mouse to navigate in addition to the keyboard.

And I try to mimick it, that hovering over ui-elements in my gui-window shows a tooltip and sends a screenreader message, as long as the window is visible.
If I need to focus the window first, all ui elements in the window become invisible for blind users until they focus the window, which can be challenging.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-31-2023, 10:09 AM   #8
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,863
Default

You can check &2 to see if the window has focus. Visibility is defined as not-hidden, but not defined as not-obscured. I suppose we could add a bit for "check to see if the mouse would hit this window if clicked"?
Justin is offline   Reply With Quote
Old 10-31-2023, 10:31 AM   #9
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,672
Default

Quote:
Originally Posted by Justin View Post
You can check &2 to see if the window has focus. Visibility is defined as not-hidden, but not defined as not-obscured. I suppose we could add a bit for "check to see if the mouse would hit this window if clicked"?
That would be great and help me tons.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-31-2023, 01:47 PM   #10
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,984
Default

Couldn't you do that with JS_Window_FromPoint(), unless you don't want to use dependencies.
Edgemeal is offline   Reply With Quote
Old 11-01-2023, 02:11 AM   #11
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,672
Default

I need to avoid dependencies with the exception of Osara for the screenreader messages.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.