Simple Window Manager - SWM

probably no need to do so unless you activate the preload option! I'll probably be the only one running into this :slight_smile:

lol i remember now and it began to make sense i tried to solve BTT uses high CPU on idle i guess its around 1 year ago. now i understand source of problem but can not remember how did i fixed back in the day. i guess i will add caution to first post to warn users to do not enable that

I checked this thread and am not sure what I am missing. When using the MBP with no or one external monitor, the right-click on the minimize button works as expected. Below is my setup when the MBP is docked. The right-click works on the two external displays, but nothing happens when the app window is on the MBP screen. Fn-W does work on the MBP Screen to bring up the actions view. I have restarted BTT, but I still have the same issue. What am I missing?

MBP (Lid open) - display (primary) - display

Sonoma 14.5
BTT 4.576
SWM 1.0.3

EDIT: My external displays are the Studio Displays at the default resolution, and the right-click does work when I reduce the resolution on the monitors to Large Text, but stops working when I switch it back to the default.

@Appolusionist i have tried different scalings on my mac but couldnt replicate your issue. maybe it can be related with negative coordinates for monitor. can you send result of this applescript

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions

set allFrames to (current application's NSScreen's screens()'s valueForKey:"frame") as list

this script will list all monitors and positions. also a screenshot of macOS settings > display > arrange would be nice

Fn+W & Fn+S still working on that monitor while right click on yellow button not working. right?

Yes, Fn+W and Fn+S work on that screen, but the right-click on the yellow button does not work. Here are the results of the AppleScript and a screenshot of my monitor arrangement.

{{{0.0, 0.0}, {2560.0, 1440.0}}, {{-1728.0, 323.0}, {1728.0, 1117.0}}, {{2560.0, 1440.0}, {1440.0, 2560.0}}}

None of videos load here. Can you put it on YouTube ?

@Appolusionist is left one is not working on arrangement?

@sunnysigara they work without problem on my mac. can you test with another browser maybe your plugin/extensions blocking it

Yes, the left one

@Appolusionist
Automations & Other Triggers > SWM - Triggers > Yellow (Minimize) button trigger > Run Real javascript > Can you replace with code at below and hit compile button

(async()=>{
	n=(await get_string_variable("hovered_element_details")).split('<AXApplication: "')[1].split('"')[0]
	trigger_named('swmfloat')
	set_persistent_string_variable({variable_name:'SWM-FA',to:(n=="")?"":(n+":"+((await get_number_variable("fullscreen_active"))==1))})
	returnToBTT(1)
})()

I just want to make sure its related with applescript part. if its not its related with "hovered_element_details"

Same issue on the left screen after compiling the new code.

@Appolusionist can you try this one and please share result of script. it will show a dialog when you trigger with SWM with yellow button

(async()=>{
	h=await get_string_variable("hovered_element_details")
	n=h.split('<AXApplication: "')[1].split('"')[0]
	p=h.split('AXPosition:  "')[1].split('"')[0]
	trigger_named('swmfloat')
	set_persistent_string_variable({variable_name:'SWM-FA',to:(n=="")?"":(n+":"+((await get_number_variable("fullscreen_active"))==1))})
	runAppleScript(`
		tell app "System Events" to tell process "BetterTouchTool"
			tell window 1 whose subrole is "AXSystemDialog" to try
				set {x,y} to position
				set position to {x+50,y+60}
			end try
			set frontmost to true
		end tell
	`)
	mx = await get_number_variable('mouse_position_x')
	my = await get_number_variable('mouse_position_y')
	alert(n + " - " + p  + " - " + mx + " , " + my)
	returnToBTT(1)
})()

try this if you dont see any dialogs.
• click on any advanced conditions button
• hovered UI element viewer
• move your cursor to minimize button while target window on that monitor
• use shift + space to freeze hovered UI element viewer
• share result

The screen recording of the TextEdit and Hovered UI Element Inspector is on my left screen. When my cursor is over the minimize button, the Element Inspector does not recognize that I am over it. Still, when I move the TextEdit window to my middle screen, the Inspector does recognize that I am over the minimize button indicated by the AXRoleDescription.

@Andreas_Hegenberg can you check this issue? confused a bit. Dont know its macOS bug or BTT bug. window not in "window list" on not register itself as window while monitor has negative numbers for positioning. Maybe hovering UI element inspector completely ignores monitors with negative positioning

It looks like there might be some invisible overlay that prevents UI element inspector from accessing it. Negative positioning should not be a problem.

Can you think of any third party app that overlays the screen at that position? Or do you maybe have floating webviews / menus in BTT that could for some reason still stick around invisibly?

Hey @yw4z, right clicking the yellow minimize button actually minimizes the window half the time, and then opens up the SWM window. Any way to prevent this? Or if not, to have title bar double click open SWM maybe?

Also it seems to crash when I try to drag on the grid :sweat_smile:

@Vexir hi
1-whats your macos version and device
2-minimizing with slow animation indicates you/btt left click with shift modifier. There are few possibilities to cause this.
• Disable other presets and leave only SWM and test again. Maybe other
• Mouse related apps might be try to catch mouse events. I know few programs can cause with BTT. Linear mouse, MOS, Steermouse etc..
• Not sure but sidecar / universal control can cause this
3- Again looks like some another window steals focus from SWM on your last post
4- you might want to share log file with @Andreas_Hegenberg to solve that crash

Let me know your results. Definitely an app, a btt preset / trigger or a system feature creates a conflict for SWM

Sonoma 14.5 on a 16" 2021 M1 Pro MBP

I definitely didn't left click, but I don't know why BTT would. There are no other presets in BTT nor mouse related apps running - just a password manager, adblockers, and Google Drive type stuff.

On the crash, it's 100% repro. It's not using the grid (which is typically left click to start, move, and left click to end), it's dragging on it without letting the click release. Happy to share logs, just let me know how.

I also ran into this bug today where continuous mode just didn't work. Then I tried again 30m later and it was fine. Then I ran into it again the same day. No clue!

@Vexir
looks like you are not in continuous mode. a dashed rectangle appears on screen edges while using continuous mode. Which shortcut did you use for switching it?

You can send log file to Andreas with personal message

Can you check which windows appear on BTT > Any action > Advanced conditions > Visible window manager

Copy and share results. Also track changes on that list while opening and closing SWM. Suspecting some app steals focus from SWM but not sure its a 3rd party app or a system feature. I didnt upgraded to sonoma yet so i didnt tested on it

It would be nice if other people on sonoma confirms its workin on their setup