-
Notifications
You must be signed in to change notification settings - Fork 0
Window attributes not updated after window move (on windows 10) #494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I forgot to copy my repl output yesterday, so I repeated the test this morning -
|
Note: in this test, the notepad.exe window started on my main display, named 'DISPLAY1'. The 'snap next' command moved the window to the display named 'DISPLAY3', which is correct. After, the window reference 'w' shown above did not show the updated values. Then, I re-acquired the 'w' reference and it did show the new values -
I expected the reference to show the updated values without needing to be reset. That's the way it used to work. |
I've also encountered this, in the same context |
@codecat555 when you say "That's the way it used to work" do you have a timeframe? git says I haven't really touched this code since December, and that was only changes to Window focus handling. I don't think I've messed with anything besides the focus code since much longer than that (maybe last June or earlier) Oh, I just realized what you meant by reacquiring
|
Yes, I was working intensively on my window move/resize code for a month or two during November/December of last year. Even into January... During that time, I frequently used the repl in this way to troubleshoot my code. To be clear, I originally started looking into this because the snap next/last commands were behaving oddly on my windows 10 system. I wasn't interested in the behavior of references, but just trying to figure out why my windows weren't behaving. For instance, at one point yesterday I said 'snap next' and the current window jumped to the next screen and then immediately popped back to its previous location.That's not happening anymore, but perhaps it's related. |
I just added some values to grab in my last comment, they may help diagnose |
In your example, should this be assignment instead?
|
|
Here's the output -
|
Can you switch to a big print in this style so it's easier to read? And try to show the
|
I remember talking about an issue similar to this on Slack a long while ago - I think it was when I was first working on the knausj window snapping implementation. When windows are manipulated programmatically with talon's API (on Windows), it seems the I remember there were issues interfacing with the Windows API and you eventually triaged them as something to tackle another time. I don't have any other notes there, so I'm not sure if other attributes came up as failing to update in the discussion. |
|
In this example, you |
Alternatively, a bool param for force refresh? |
The problem magically fixed itself while I was working on reproducing the problem with the alternate formatting you requested. I didn't make any changes to my system or talon config, I didn't restart talon or the repl or use a different target window. All I did was switch between various windows and edit the test code. Very frustrating. Here's the output, just to document the new test procedure -
|
BTW, here's some more background information which may be helpful. When things were acting weird, 'snap next' and 'snap last' we're only working across two of my three screens. Normally, one can say 'snap next' or 'snap last' repeatedly and cycle through all of one's screens. That just stops working sometimes - the second 'snap next' or 'snap last' command just does nothing. That was true for me earlier, but now it's all working fine again. I've seen this problem more than a few times. Perhaps I should also mention that I actually have four screens on my system, since it's a laptop. I almost always use it with the lid closed and connected to a docking station. One of the external displays is plugged directly into the HDMI port on the laptop and the other two are connected to the docking station (one HDMI and one DisplayPort). I wouldn't expect these low level details to make any difference to Talon, since the Windows layer seems to have no problems with this setup. Indeed, ui.screens() correctly shows just the 3 external displays. I do see problems if I leave talon running and disconnect from the docking station and then reconnect later. A reboot clears that up. |
Talon version: v0.2.0-376-gd29b (376) Update - I just hit another instance of bizarre 'snap next' behavior. It's a problem that recurs with some regularity, if intermittently. In fact, it's the problem that originally caused me to start investigating things and eventually leading to this bug. I had a firefox window on my main (middle) screen, sized to about 50% of the screen and roughly centered. I said 'snap next' and instead of jumping to the next screen, the window jumped to the upper left corner of the same screen and shrunk down to a fraction of its original size. Since this is a recurring problem, I had added some debug code to log some additional information. This is what it printed, note the bizarre window coordinates (-31993, -32000) (also, the width and height are not correct):
Here's what the repl shows for my screens -
This was shortly after resuming from hibernate, and I wonder if that might have something to do with talon's confusion. For clarity, here is the diff showing my debug changes relative to the stock
|
I believe this is fixed on Talon 0.3.1-49-g8e47. If you encounter it on that version or later, before restarting Talon, please open the repl and run
and post the output here, as well as your Talon version. Thanks! |
I've noticed that the 'snap next' command is no longer working as expected on my windows 10 system (and 'snap last', and related commands).
This seems to be due to a failure to update the window attributes after moving the window.
For example, I used the repl to display the attributes of a notepad.exe window on my main screen (DISPLAY1). Then, I ran the 'snap next' command while the notepad window was focused. The notepad window did in fact move to the next screen (DISPLAY3), but the window attributes (including the window screen) reported by the repl were unchanged.
I recorded a video of this test, but it's too big to upload here (112 mb). I also have the talon log and I captured the event log.
The text was updated successfully, but these errors were encountered: