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

Un-hiding chrome causes resize issue. #300

Closed
alok opened this issue Nov 4, 2019 · 13 comments
Closed

Un-hiding chrome causes resize issue. #300

alok opened this issue Nov 4, 2019 · 13 comments
Labels
bug Something isn't working

Comments

@alok
Copy link

alok commented Nov 4, 2019

I have the screen split (vertically) evenly between chrome and kitty.

I hide chrome with cmd+h. Kitty is now the only app in view.

I then unhide chrome. Kitty resizes to half the screen, but chrome only resizes to a fourth, leaving a quarter of the screen unused.

If I use the native fullscreen on chrome and switch back, it fixes the issue, but I have to do that every time I hide chrome.

@Peeja
Copy link

Peeja commented Nov 4, 2019

I'm seeing this too. Switching spaces back and forth also fixes the issue. My guess is that Chrome is making some kind of "false" window that yabai is picking up on, it's destroying that window in some way yabai doesn't notice, and then it has to be nudged to recalculate everything.

I know Chrome's little URL preview is a "window" for some definition, because Zoom offers to screen share it during meetings. Could that be what's doing it?

image

@dominiklohmann
Copy link
Collaborator

Likely related: #164 (don't think these are properly ignored for unhiding)

@koekeishiya
Copy link
Owner

Role is also checked upon unhiding. Simply having Kitty open. Launching Chrome, navigate to some website, hide Chrome, unhide Chrome, is not enough to reproduce the issue for me. Tested both while having the url-window visible and without it. Need more information somehow before I can try to pinpoint what is happening here.

@koekeishiya koekeishiya added bug Something isn't working obscure Weird behaviour that is difficult to debug labels Nov 6, 2019
@alok
Copy link
Author

alok commented Nov 6, 2019 via email

@koekeishiya
Copy link
Owner

My first thought would be to add the ability to inspect/dump the underlaying tree structure to file. It would be trivial to also dump information about the window that belongs to each leaf node.

Having an output like that would make it fairly trivial to identify what the problem is. The next step would then be to try and figure out how that scenario was able to occur in the first place.

I guess this could be something like yabai -m debug --dump-state or something, and it should probably take an optional space selector to limit the output. I haven't exactly thought this through yet, but that is my initial take on how to proceed.

@Peeja
Copy link

Peeja commented Jan 9, 2020

I'm able to get yabai to recompute correctly by entering Expose, or even just barely starting to enter Expose with the trackpad, and going back. Is there something I could do from the command line that might accomplish the same thing? If so, a workaround for now might be to attach that command to an application_visible signal for Chrome.

@koekeishiya
Copy link
Owner

This should be fixed after the changes made for #348

@Peeja
Copy link

Peeja commented Jan 21, 2020

Hooray! Thank you!

@Peeja
Copy link

Peeja commented Jan 21, 2020

Hmm, I'm still seeing this. :/

image

$ yabai -v
yabai-v2.2.2

$ yabai -m query --windows
[{
	"id":180481,
	"pid":1333,
	"app":"iTerm2",
	"title":"zsh",
	"frame":{
		"x":10.0000,
		"y":36.0000,
		"w":941.0000,
		"h":1149.0000
	},
	"level":0,
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"display":1,
	"space":1,
	"visible":1,
	"focused":1,
	"split":"vertical",
	"floating":0,
	"sticky":0,
	"topmost":0,
	"border":0,
	"shadow":1,
	"zoom-parent":0,
	"zoom-fullscreen":0,
	"native-fullscreen":0
},{
	"id":180377,
	"pid":16340,
	"app":"Google Chrome",
	"title":"Un-hiding chrome causes resize issue. · Issue #300 · koekeishiya/yabai - Google Chrome - Petra",
	"frame":{
		"x":965.0000,
		"y":36.0000,
		"w":945.0000,
		"h":572.0000
	},
	"level":0,
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"display":1,
	"space":1,
	"visible":1,
	"focused":0,
	"split":"horizontal",
	"floating":0,
	"sticky":0,
	"topmost":0,
	"border":0,
	"shadow":1,
	"zoom-parent":0,
	"zoom-fullscreen":0,
	"native-fullscreen":0
}]

I've restarted yabai and reinstalled the payload, so it should be running the right code. Is there anything else I can do to help debug?

@koekeishiya
Copy link
Owner

koekeishiya commented Jan 21, 2020

I really don't get why i don't have this problem???

Anyway, someone will have to investigate this by actually running a debug build of yabai in a debugger and stepping through the code to figure out what is going on.

You can start by setting a breakpoint at: https://github.com/koekeishiya/yabai/blob/master/src/event.c#L425 to see the value of window_count. In the following loop you can inspect the window struct and look at the id of the window. This will help clarify that the same window is not being tiled twice, and it should not be possible for that to happen either, after the latest changes.

@koekeishiya
Copy link
Owner

The only reason I can think of would be if there is a minimized window, and then the application is unhidden?

@koekeishiya koekeishiya reopened this Jan 21, 2020
koekeishiya added a commit that referenced this issue Jan 21, 2020
@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released and removed obscure Weird behaviour that is difficult to debug labels Jan 21, 2020
@koekeishiya
Copy link
Owner

Theory regarding minimized window turned out to be correct. Usually the API does not return minimized windows through the AX API in this scenario, but apparently Chrome does for some reason...

@Peeja
Copy link

Peeja commented Jan 21, 2020

Aha! Can confirm: if I have no Chrome windows minimized, this doesn't happen. If I have two windows minimized, I can prove they're both accounted in the empty space for by running yabai -m space --balance.

brorbw pushed a commit to brorbw/yabai that referenced this issue Jan 28, 2020
…den (required by some applications like Chrome..)
@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Feb 12, 2020
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

4 participants