Skip to content
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

Blank space appears when restoring minimised window #70

Closed
eramdam opened this issue Jun 25, 2019 · 6 comments
Closed

Blank space appears when restoring minimised window #70

eramdam opened this issue Jun 25, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@eramdam
Copy link

eramdam commented Jun 25, 2019

I can't exactly pinpoint (yet) a specific pattern but I've seen that happen quite a few times on my work machine, I would restore a window that was minimized and then there would be a blank space in the tiling, as if there was a "ghost" window there 😕

I'll try to gather some logs around the time when it happens to see if there's any errors popping up.

FWIW I'm on a dual monitor setup (built-in display + 4K monitor) on a 2015 MBP and it happened ~5times yesterday but I have never seen that on my desktop computer with a similar monitor setup so i don't know if it's a performance issue?

EDIT:
Okay here are some query results on a space where that happened. I'm remembering that my secondary display is on the left of the main one, making it having a negative x value, maybe that's relevant for the issue? (My desktop computer has its secondary display on the right so the x is probably positive)

yabai -m query --displays --space
{
	"id":69733248,
	"index":2,
	"spaces":4,
	"frame":{
		"x":-1920.0000,
		"y":495.0000,
		"w":1920.0000,
		"h":1200.0000
	}
}
» yabai -m query --spaces --space
{
	"id":6,
	"index":4,
	"display":2,
	"windows":2,
	"type":"bsp"
}
» yabai -m query --windows --space
[{
	"id":2963,
	"pid":22607,
	"app":"iTerm2",
	"title":"/usr/local/var/log/yabai",
	"frame":{
		"x":-1898.0000,
		"y":1118.0000,
		"w":1161.0000,
		"h":552.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
},{
	"id":479,
	"pid":6809,
	"app":"Front",
	"title":"Front",
	"frame":{
		"x":-1898.0000,
		"y":539.0000,
		"w":1165.0000,
		"h":700.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
}]
» yabai -m query --displays
[{
	"id":722476558,
	"index":1,
	"spaces":1,
	"frame":{
		"x":0.0000,
		"y":0.0000,
		"w":3840.0000,
		"h":2160.0000
	}
},{
	"id":69733248,
	"index":2,
	"spaces":4,
	"frame":{
		"x":-1920.0000,
		"y":495.0000,
		"w":1920.0000,
		"h":1200.0000
	}
}]
@dominiklohmann
Copy link
Collaborator

Can you run yabai --verbose (need to stop the launch agent first) and show the output around the time this happens?

@eramdam
Copy link
Author

eramdam commented Jun 25, 2019

I'll try that, in the mean-time I noticed I can repro consistenyl by opening a new Finder tab

EVENT_HANDLER_MOUSE_DOWN: 1457.49, 1716.91
EVENT_HANDLER_MOUSE_UP: 1457.49, 1716.91
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Finder
EVENT_HANDLER_APPLICATION_DEACTIVATED: iTerm2
EVENT_HANDLER_APPLICATION_ACTIVATED: Finder
EVENT_HANDLER_WINDOW_CREATED: Finder 8016
EVENT_HANDLER_WINDOW_RESIZED: Finder 7894
EVENT_HANDLER_WINDOW_MOVED: Finder 8016
EVENT_HANDLER_WINDOW_RESIZED: Finder 8016
EVENT_HANDLER_WINDOW_FOCUSED: Finder 8016
EVENT_HANDLER_MOUSE_DOWN: 833.43, 939.75
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: iTerm2
EVENT_HANDLER_APPLICATION_DEACTIVATED: Finder
EVENT_HANDLER_APPLICATION_ACTIVATED: iTerm2
EVENT_HANDLER_MOUSE_UP: 833.43, 939.75
EVENT_HANDLER_MOUSE_DOWN: 176.46, 0.00
EVENT_HANDLER_MOUSE_UP: 176.46, 0.00
EVENT_HANDLER_MOUSE_DOWN: 591.72, 396.96
EVENT_HANDLER_MOUSE_UP: 592.27, 396.96
EVENT_HANDLER_MOUSE_DOWN: 34.31, 1033.27
EVENT_HANDLER_MOUSE_UP: 458.51, 1009.47
EVENT_HANDLER_MOUSE_DOWN: 418.52, 1018.75
EVENT_HANDLER_MOUSE_UP: 48.66, 636.89
EVENT_HANDLER_MOUSE_DOWN: 27.55, 632.83
EVENT_HANDLER_MOUSE_UP: 530.37, 1096.78

image

@dominiklohmann
Copy link
Collaborator

See #68 for the tabs issue. This has a long history.

@eramdam
Copy link
Author

eramdam commented Jun 25, 2019

Hum, I don't remember chunkwm having the same issue, but maybe it's because I wasn't using tabs as much. I just thought it'd be somewhat related to the issue I mentioned at first. I'll run yabai with verbose mode for the rest of the day to see if I can catch anything.

@eramdam
Copy link
Author

eramdam commented Jun 25, 2019

Ok it just happened, here are the logs:

yabai --verbose around when it happened

EVENT_HANDLER_WINDOW_FOCUSED: Finder 8295
EVENT_HANDLER_MOUSE_DOWN: 543.35, 794.93
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: iTerm2
EVENT_HANDLER_APPLICATION_DEACTIVATED: Finder
EVENT_HANDLER_APPLICATION_ACTIVATED: iTerm2
EVENT_HANDLER_MOUSE_UP: 543.35, 794.93
EVENT_HANDLER_WINDOW_TITLE_CHANGED: iTerm2 7845
EVENT_HANDLER_MOUSE_DOWN: 2262.45, 2146.20
EVENT_HANDLER_MOUSE_UP: 2262.45, 2146.20
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Code
EVENT_HANDLER_APPLICATION_DEACTIVATED: iTerm2
EVENT_HANDLER_APPLICATION_ACTIVATED: Code
EVENT_HANDLER_WINDOW_DEMINIMIZED: window Code 3752 is deminimized on active space
EVENT_HANDLER_WINDOW_TITLE_CHANGED: iTerm2 7845
EVENT_HANDLER_WINDOW_RESIZED: iTerm2 7845
EVENT_HANDLER_WINDOW_MOVED: Code 3752
EVENT_HANDLER_WINDOW_RESIZED: Code 3752
EVENT_HANDLER_WINDOW_FOCUSED: Code 3752
EVENT_HANDLER_WINDOW_MOVED: Code 3752
EVENT_HANDLER_WINDOW_RESIZED: Code 3752
EVENT_HANDLER_WINDOW_TITLE_CHANGED: iTerm2 7845
EVENT_HANDLER_MOUSE_DOWN: 735.49, 641.95
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: iTerm2
EVENT_HANDLER_APPLICATION_DEACTIVATED: Code
EVENT_HANDLER_APPLICATION_ACTIVATED: iTerm2
EVENT_HANDLER_MOUSE_UP: 735.49, 641.95
EVENT_HANDLER_WINDOW_TITLE_CHANGED: iTerm2 7845
EVENT_HANDLER_MOUSE_DOWN: 1245.98, 797.17
EVENT_HANDLER_MOUSE_UP: 1245.98, 797.17
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Finder
EVENT_HANDLER_APPLICATION_DEACTIVATED: iTerm2
EVENT_HANDLER_APPLICATION_ACTIVATED: Finder
EVENT_HANDLER_MOUSE_DOWN: 2055.72, 1347.48
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Code
EVENT_HANDLER_APPLICATION_DEACTIVATED: Finder
EVENT_HANDLER_APPLICATION_ACTIVATED: Code
EVENT_HANDLER_MOUSE_UP: 2055.72, 1347.48
EVENT_HANDLER_MOUSE_DOWN: 1969.84, 1089.85
EVENT_HANDLER_MOUSE_UP: 1969.84, 1089.85
EVENT_HANDLER_WINDOW_MINIMIZED: Code 3752
EVENT_HANDLER_WINDOW_TITLE_CHANGED: iTerm2 7845
EVENT_HANDLER_WINDOW_RESIZED: iTerm2 7845
EVENT_HANDLER_MOUSE_DOWN: 2089.87, 1519.85
EVENT_HANDLER_MOUSE_UP: 2089.87, 1519.85
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Finder
EVENT_HANDLER_APPLICATION_DEACTIVATED: Code
EVENT_HANDLER_APPLICATION_ACTIVATED: Finder
EVENT_HANDLER_MOUSE_DOWN: 1523.00, 1665.59
EVENT_HANDLER_MOUSE_UP: 1520.71, 1667.23
EVENT_HANDLER_WINDOW_FOCUSED: Finder 8295
EVENT_HANDLER_WINDOW_TITLE_CHANGED: iTerm2 7845
EVENT_HANDLER_MOUSE_DOWN: 2143.88, 721.84
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Firefox
EVENT_HANDLER_APPLICATION_DEACTIVATED: Finder
EVENT_HANDLER_APPLICATION_ACTIVATED: Firefox
EVENT_HANDLER_MOUSE_UP: 2143.88, 721.84
EVENT_HANDLER_MOUSE_DOWN: 449.06, 691.57
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: iTerm2
EVENT_HANDLER_APPLICATION_DEACTIVATED: Firefox
EVENT_HANDLER_APPLICATION_ACTIVATED: iTerm2
EVENT_HANDLER_MOUSE_UP: 449.06, 691.57
EVENT_HANDLER_WINDOW_TITLE_CHANGED: iTerm2 7845
process_handler: osascript was marked as background only! ignoring..
EVENT_HANDLER_MOUSE_DOWN: 33.94, 597.62

query before I relaunched yabai to fix the issue

» yabai -m query --windows --space
[{
	"id":7845,
	"pid":22607,
	"app":"iTerm2",
	"title":"~/Music/XLD",
	"frame":{
		"x":22.0000,
		"y":44.0000,
		"w":929.0000,
		"h":1000.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
},{
	"id":4057,
	"pid":21286,
	"app":"Firefox",
	"title":"[5] Blank space appears when restoring minimised window · Issue #70 · koekeishiya/yabai",
	"frame":{
		"x":1932.0000,
		"y":44.0000,
		"w":1886.0000,
		"h":1013.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
},{
	"id":3752,
	"pid":26647,
	"app":"Code",
	"frame":{
		"x":1932.0000,
		"y":1081.0000,
		"w":1886.0000,
		"h":1012.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
},{
	"id":8295,
	"pid":740,
	"app":"Finder",
	"title":"/Users/damien/Music/XLD/Depeche Mode_R1-587589",
	"frame":{
		"x":22.0000,
		"y":1081.0000,
		"w":1886.0000,
		"h":1012.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
}]

query after relaunching yabai

» yabai -m query --windows --space
[{
	"id":7845,
	"pid":22607,
	"app":"iTerm2",
	"title":"~/Music/XLD",
	"frame":{
		"x":22.0000,
		"y":44.0000,
		"w":930.0000,
		"h":1000.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
},{
	"id":8295,
	"pid":740,
	"app":"Finder",
	"title":"/Users/damien/Music/XLD/Depeche Mode_R1-587589",
	"frame":{
		"x":977.0000,
		"y":44.0000,
		"w":931.0000,
		"h":1012.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
},{
	"id":4057,
	"pid":21286,
	"app":"Firefox",
	"title":"[5] Blank space appears when restoring minimised window · Issue #70 · koekeishiya/yabai",
	"frame":{
		"x":1932.0000,
		"y":44.0000,
		"w":1886.0000,
		"h":2049.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
},{
	"id":3752,
	"pid":26647,
	"app":"Code",
	"title":"viewerPanelActions.ts — front-client",
	"frame":{
		"x":22.0000,
		"y":1081.0000,
		"w":1886.0000,
		"h":1012.0000
	},
	"level":"0",
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"native-fullscreen":0,
	"floating":0
}]

koekeishiya added a commit that referenced this issue Jun 25, 2019
@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released bug Something isn't working labels Jun 25, 2019
@koekeishiya
Copy link
Owner

koekeishiya commented Jun 25, 2019

Fixed on master.

When a window is deminimized, macOS will automtically give focus to the space that window belongs to. In a multi-display setup, this would trigger a display changed event, and a window deminimized event for that window. The window would be added twice to the window-tree, once because we detect unmanaged windows upon space activation, and a second time because of the deminimized event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants