@@ -16,10 +16,11 @@ app_name = Vimium Everywhere Gui
16
16
; Can be any color, but this value prevents a flickering until TransColor comes into effect (Linux):
17
17
win_trans_color = rgba(0 `,0 `,0 `,0 )
18
18
19
+ DetectHiddenWindows , On
19
20
; Figure out the offset which an invisible, caption-less Gui window still always has.
20
21
; Expected is 0/0, but can be a few pixels.
21
- Gui , - Caption + ToolWindow
22
- Gui , Show , x0 y0, %app_name%
22
+ Gui , - Caption + ToolWindow + 0x80000000 + E0x8000000
23
+ Gui , Show , x0 y0, %app_name% ; TODO also match pid somehow
23
24
; TODO: Use WinWaitExist *command* instead (AHK_X11 does not yet offer it)
24
25
GoSub , WinWaitExist
25
26
; TODO: For all matches by app_name use compare by Gui WID instead (AHK_X11 does not yet offer it)
@@ -282,8 +283,8 @@ Show:
282
283
}
283
284
; TODO: Use WinWaitExist *command* instead (AHK_X11 does not yet offer it)
284
285
GoSub , WinWaitExist
286
+ ; Because of 0x80000000, our gui never takes focus unless we force it with WinActivate.
285
287
WinGet , gui_win_id, ID , %app_name%
286
- WinActivate , ahk_id %gui_win_id%
287
288
WinSet , TransColor , %win_trans_color%, ahk_id %gui_win_id%
288
289
WinSet , Transparent , 230 , ahk_id %gui_win_id%
289
290
WinSet , AlwaysOnTop , ON , ahk_id %gui_win_id%
@@ -310,10 +311,6 @@ Show:
310
311
If control <>
311
312
ControlClick , %control %, ahk_id %show_active_win_id%
312
313
Gui , Hide
313
- ; To prevent Gui from being the active window in the next `Build` call, we need to wait
314
- ; for `Hide` to finish. Both WinSet, Bottom and WinMinimize did not help here.
315
- ; TODO: Use WinWaitNotActive *command* instead (AHK_X11 does not yet offer it)
316
- GoSub , WinWaitNotActive
317
314
is_showing = 0
318
315
If simple_mode <> 1
319
316
{
@@ -336,15 +333,6 @@ Scroll_Up:
336
333
Send , {Up }
337
334
Return
338
335
339
- WinWaitNotActive :
340
- Loop
341
- {
342
- WinGetTitle , active_win_title, A
343
- If active_win_title <> %app_name%
344
- Break
345
- Sleep , 50
346
- }
347
- Return
348
336
WinWaitExist :
349
337
Loop
350
338
{
0 commit comments