-
Notifications
You must be signed in to change notification settings - Fork 841
Fix incorrect layout when window is resized externally #3291
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
base: master
Are you sure you want to change the base?
Conversation
|
Another possible way to deal with this issue is to only run |
|
|
@clayreimann |
|
@clayreimann |
|
Woops, my bad, yes, it works correctly for me when moving a window to a monitor with a lower vertical resolution :) |
|
Wow, sorry that this has been lingering here for so long. This was just a way to give proof of a fix and maybe give a more informed person, such as yourself, a vantage point to create a "proper" fix.
This is a strange collaboration technique to me. It's been over a year this has been here without conflicts with master. This tiny PR fixes a very annoying bug and there's only been a discussion about how you don't want to review it because I didn't ask for permission to submit a PR? That's bureaucratically bonkers!
I did not totally ignore your assessment in #3091. It was just the only part I found relevant was this:
This PR addresses that by deferring With this fix, opening a second tab that triggers the animation, Without this fix, opening a second tab that triggers the animation, I admit that this feels like a workaround by adding a guard to the tab animation. But, it's the fastest and least invasive way to get around a bug that can't be fixed without totally restarting the program. I am asking you to please review this for the sake of fixing a very annoying and old bug. If this PR feels too hacky, here's a patch that accomplishes the same thing by debouncing the diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.h b/Frameworks/PSMTabBar/PSMTabBarControl.h
index dee4ed8a..9e98feb9 100644
--- a/Frameworks/PSMTabBar/PSMTabBarControl.h
+++ b/Frameworks/PSMTabBar/PSMTabBarControl.h
@@ -116,2 +116,3 @@ enum {
NSTimer *_showHideAnimationTimer;
+ NSTimer *_updateDebounceTimer;
diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m
index 7fcf5840..9cfe4f4f 100644
--- a/Frameworks/PSMTabBar/PSMTabBarControl.m
+++ b/Frameworks/PSMTabBar/PSMTabBarControl.m
@@ -1693,3 +1693,15 @@
- [self update:NO];
+ if ([[self window] inLiveResize]) {
+ [self update:NO];
+ } else {
+ // Debounce updates
+ if ([_updateDebounceTimer isValid]) {
+ [_updateDebounceTimer invalidate];
+ [_updateDebounceTimer release];
+ }
+
+ _updateDebounceTimer = [[NSTimer scheduledTimerWithTimeInterval:0.5 repeats:NO block:^(NSTimer * _Nonnull timer) {
+ [self update:NO];
+ }] retain];
+ } |
|
@dmoagx could you please seriously consider this pull request? The bug that the layout gets screwed up when a 3rd party app resizes the app is really annoying and clearly it's bothering more people. If this PR indeed fixes that bug then that would be such a relief to me and most likely a lot of other people who use this app. From your earlier responses I interpret that you were somewhat annoyed or fed up with something? I'm not sure that I fully understand where it came from, but I'm guessing you wanted to protect your time and energy and you wanted other people to consider your time and energy too, is that right? I don't know if you still feel the same way, but if you do I wonder if there's a way both of us can get what we want. For example, is there anyone else you trust to be able to review this code and judge whether it's good enough to merge and release? I don't know. A lot of what I'm saying is based on assumptions, because I don't know you of course and I can't see what your face is expressing while you're reading this. But I hope you're open to talk about this if you still feel some resistance towards reviewing and possibly merging this PR. |
|
Is this really still not fixed in nightly builds? I'm still using the binary I built from this PR branch in July, waiting for the issue to close. This bug makes sequel pro completely unusable for me as I daily plug/unplug my mac to a couple of external monitors which makes some sequel pro windows permanently unusable. |
|
@Evertt Even if I would merge this, there would be no change. Nightly builds are broken for months, so you'd have to compile it yourself to see the change - the same as it is right now. |
|
Yup, my builder not getting triggered any more :( https://build.spdevlog.com is down... |
|
Well, we've relied on (mostly) resigned project members for that infrastructure, so I don't want to blame anyone for this or have to constantly nag people who've decided they'd rather spend their valuable spare time on other efforts. |
|
For anyone interested, we're trying to get a fork of Sequel Pro going. This fix and others have been merged in, and there's a downloadable beta that's notarized for macOS for anyone who wants to try it! Sequel Pro is/was awesome. I think @dmoagx hit the nail on the head - we can't blame anyone for this or nag people who want to do other things. All we can do is move forward and try to make a great, free tool for everyone. |
Not sure if the title is an accurate description.
This fixes #3091 and doesn't seem to disrupt the normal animations involved in adding/removing/moving tabs. I think this is good enough for fixing a disruptive workflow bug even though it doesn't address the bug mentioned in #3091 (comment).
IMO, a practical approach to the overall problem is to not animate the tab bar's visibility so that the partnerView is updated immediately using current dimensions.