Skip to content

Commit

Permalink
optimize: GetMouseMonitorMidX()
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Sep 15, 2021
1 parent 64cdeba commit 93df343
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
14 changes: 7 additions & 7 deletions app_data/ev_sup/Everything.ini
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,13 @@ translucent_selection_rectangle_background_color=
translucent_selection_rectangle_border_color=
thumbnail_mouseover_border_color=
preview_background_color=
ntfs_volume_guids="\\\\?\\Volume{cfb85dc4-945d-49be-996a-60c32ff45868}","\\\\?\\Volume{01d15d50-0000-0000-0080-000000000000}","\\\\?\\Volume{baa8b914-27c0-4df7-ae64-eb0adf6a9f70}","\\\\?\\Volume{204f923c-7da5-49b8-b677-3d6b9f14a032}","\\\\?\\Volume{7da7cc7b-4212-4aa7-9a1a-a3433a8216b2}"
ntfs_volume_paths="C:","D:","C:","D:","E:"
ntfs_volume_roots="","","","",""
ntfs_volume_includes=1,1,1,1,1
ntfs_volume_load_recent_changes=0,0,0,0,0
ntfs_volume_include_onlys="","","","",""
ntfs_volume_monitors=1,1,1,1,1
ntfs_volume_guids="\\\\?\\Volume{cfb85dc4-945d-49be-996a-60c32ff45868}","\\\\?\\Volume{01d15d50-0000-0000-0080-000000000000}","\\\\?\\Volume{baa8b914-27c0-4df7-ae64-eb0adf6a9f70}","\\\\?\\Volume{204f923c-7da5-49b8-b677-3d6b9f14a032}","\\\\?\\Volume{7da7cc7b-4212-4aa7-9a1a-a3433a8216b2}","\\\\?\\Volume{bbbfa20f-c35a-4f1b-abef-6252b8667f85}","\\\\?\\Volume{fe25685c-5049-4587-8cf6-a565286803c1}","\\\\?\\Volume{bbc15c08-856f-4a01-ba22-837bb80701f0}"
ntfs_volume_paths="C:","D:","C:","D:","E:","C:","D:","E:"
ntfs_volume_roots="","","","","","","",""
ntfs_volume_includes=1,1,1,1,1,1,1,1
ntfs_volume_load_recent_changes=0,0,0,0,0,0,0,0
ntfs_volume_include_onlys="","","","","","","",""
ntfs_volume_monitors=1,1,1,1,1,1,1,1
refs_volume_guids=
refs_volume_paths=
refs_volume_roots=
Expand Down
30 changes: 10 additions & 20 deletions source/util.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -498,28 +498,18 @@ IsMouseActiveWindowAtSameMonitor(cur_active_window_X="") {

GetMouseMonitorMidX() {
MouseGetPos, Mouse_x
; yScrnOffset := A_ScreenHeight / 4
SysGet, mon_cnt, MonitorCount
; if (mon_cnt == 1) {
; Gui, Show, xCenter y%yScrnOffset%, myGUI
; return
; }
; else {
xMidScrn := 0
last_mon_width := 0
Loop, % mon_cnt
{
SysGet, Mon, Monitor, % A_Index
_mon_width := (MonRight - MonLeft)
xMidScrn += _mon_width
last_mon_width := _mon_width
if (Mouse_x >= MonLeft && Mouse_x < MonRight)
break
xMidScrn := 0
last_mon_width := 0
Loop, % mon_cnt
{
SysGet, Mon, Monitor, % A_Index
_mon_width := (MonRight - MonLeft)
if (Mouse_x >= MonLeft && Mouse_x < MonRight) {
xMidScrn := MonLeft + (_mon_width / 2)
break
}
xMidScrn -= last_mon_width / 2
; xMidScrn -= cur_theme_info["sux_width"] / 2
; Gui, Show, x%xMidScrn% y%yScrnOffset%, myGUI
; }
}
return xMidScrn
}

Expand Down

0 comments on commit 93df343

Please sign in to comment.