Commit graph

52 commits

Author SHA1 Message Date
Kang Yu
0dd37cf785 Fix flickering window loop issue in V3.0 and V3.1
Restore window z order
Restore maximized window indicator
2020-02-18 14:32:02 -08:00
Kang Yu
8faa833fbe fix miss capture of new window 2020-02-17 22:51:41 -08:00
Kang Yu
c430ea7d3e avoid excessive capture during restore 2020-02-17 21:21:21 -08:00
Kang Yu
b1d6ecb04e Measure window move speed to recognize OS initiated move.
Replace MoveWindow() with SetWindowPos() to preserve window depth
2020-02-17 17:16:11 -08:00
Kang Yu
02de0b3216 fine tune timer latency for slow remote desktop connection 2020-02-16 23:06:11 -08:00
Kang Yu
505d6d9126 Avoid capture when display setting changes before event handler is called
Distinguish user initiated move/resize from OS initiated move/resize
Introduce load-adaptive capture speed control for slow remote desktop connection
2020-02-16 22:27:03 -08:00
Kang Yu
a134d2f337 adjust timer latency so that capture takes longer than recovery, this is required for second recovery pass 2020-02-14 18:21:25 -08:00
Kang Yu
1e04039dd2 implement second restore pass in a more elegant way 2020-02-14 15:43:54 -08:00
Kang Yu
4a25903024 Improve capture/restore accuracy using timer and event handler 2020-02-14 15:41:21 -08:00
Kang Yu
4f6eb079e1 avoid conversion between User32Events and uint 2020-02-11 23:45:06 -08:00
Kang Yu
fadf717d24 clean up unused code 2020-02-11 23:18:48 -08:00
Kang Yu
9a301996c2 Reimplement capture/restore using event handler 2020-02-11 23:12:22 -08:00
Kang Yu
f9ccb9e4ed Turn on pure event driven window capture to fix miscatpture issues.
Turn on system suspend event handler to avoid miscapture.
2020-02-10 23:45:27 -08:00
Kang Yu
636ff55291 merge event driven handler code from WindowMagic to reduce cpu usage due to polling 2020-02-08 21:56:46 -08:00
Kang Yu
4ce4f53941 disable event-driven window movement detection due to insufficient capability. Re-enable polling method with thread safety enhancement 2020-02-06 19:20:21 -08:00
Kang Yu
55851c6847 merge from WindowMagic by Sean Aitken:
1. use event driven detection instead of polling
2. add Dispose() method to free resources
2020-02-06 19:20:21 -08:00
Kang Yu
36182585a4 tentative fix to improve reliability, avoid risk condition or potential crash 2020-02-05 22:09:18 -08:00
Kang Yu
7170ad0698 update comment 2020-02-03 16:58:13 -08:00
Kang Yu
a7b15a0f22 fix flickering window issue introduced in V2.6, try recover old WindowPlacement only once 2020-01-31 16:26:17 -08:00
Kang Yu
8b749413f9 stay locked during double restore 2020-01-30 19:13:42 -08:00
Kang Yu
d724a282f8 1. Call restore window position routine twice to reliably restore window snapped to screen edge, as Windows OS may undo restore for unknown reasons.
2. Automatically undo unexpected WindowPlacement change when screen position stays the same, the unexpected behavior happens right AFTER window pos restoration is done
2020-01-30 12:11:52 -08:00
Kang Yu
f3fd7b2e60 improve debug message 2020-01-30 12:11:52 -08:00
Kang Yu
7f6cf70c95 remove unused "using ..." 2020-01-29 11:13:08 -08:00
Kang Yu
c015d27fc8 remove unused Dispose() method 2020-01-29 11:09:06 -08:00
Kang Yu
de4bc1e709 minor coding style and message change 2020-01-29 11:03:10 -08:00
Kang Yu
a84b5f07bc simplify window recovery procedure 2020-01-29 10:58:30 -08:00
Kang Yu
c82aaa3c59 remove dos new line 2020-01-29 10:55:32 -08:00
Kang Yu
7e4f3820b1 reject false window placement change when real screen position does not 2020-01-29 09:37:38 -08:00
Kang Yu
dd0a31dfc7 remove obsolete code 2020-01-28 12:39:49 -08:00
Kang Yu
eda1839e4a rename local var to emphasize current and previous value 2020-01-28 12:30:21 -08:00
Kang Yu
4bda3525db avoid taking invalid value in WindowPlacement by focusing only on normal position part 2020-01-28 01:00:39 -08:00
Kang Yu
52fed8b1c8 use process id to resolve hash key (hwnd) conflict 2020-01-27 20:26:20 -08:00
Kang Yu
fe4fd6f8d0 safe guard hash collision between destroyed window and new window 2020-01-27 01:20:10 -08:00
kangyu
9406f220d4 rename variable name to indicate screen coordinate instead of workspace coordinate 2020-01-26 12:59:17 -08:00
kangyu
357756d384 reduce the amount of MoveWindow() call 2020-01-26 12:55:57 -08:00
kangyu
b7fcca2df6 reliably restore window position by calling SetWindowPlacement() first, followed by MoveWindow(). Required for release build 2020-01-26 01:51:16 -08:00
kangyu
f3f414797a smooth window location update using 3 second window to reduce noise across timer boundary 2020-01-26 01:06:29 -08:00
kangyu
b2216a3a9e refix failure to restore snapped window using GetWindowRect()/MoveWindow() API in addition to GetWindowPlacement()/SetWindowPlacement() 2020-01-26 00:06:29 -08:00
kangyu
49aedbde38 rename variable and magic const 2020-01-25 14:26:45 -08:00
kangyu
d148fa4119 fix inconsistent snap window recovery 2020-01-25 14:00:44 -08:00
kangyu
a632877ee4 fix failure to restore snapped window 2020-01-25 01:03:39 -08:00
kangyu
c132f80c2b recapture all window position right after restore, also clear waiting counter to avoid hazard with next restore 2020-01-23 20:42:14 -08:00
kangyu
33b6fd26de enhance window position comparison 2020-01-23 20:17:06 -08:00
kangyu
0c075ab4b2 postpone goofy window movement update by waiting as long as 60 seconds. Refine coding style 2019-12-23 22:47:46 -08:00
kangyu
589989844d resolve issue when switching between rdp sessions with different monitor configuration 2019-12-22 21:40:21 -08:00
kangyu
93b905ed00 simplify code, update comment 2019-12-22 19:59:32 -08:00
kangyu
d3633e26a8 limit 2 window position update per second 2019-12-22 19:59:32 -08:00
kangyu
a09f07b17a add comment on runtime fix 2019-12-22 19:59:31 -08:00
kangyu
a9d14eee07 keep compatibility with legacy windows 7/8 2019-12-22 19:59:31 -08:00
kangyu
67b801370b windows10 update: fix display name variation in rdp session; fix hang in call to SetWindowsPosition for "CodeSetup*" 2019-12-21 18:27:25 -08:00