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

Having scroll bar, and Finder tabs being reported as separate windows #256

Closed
ngocphamm opened this issue Apr 20, 2020 · 7 comments
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@ngocphamm
Copy link

There are 2 separated potential issues I see, captured within this one screenshot
Screen Shot 2020-04-20 at 9 48 17 AM

  1. The list has a scroll bar, and there is actually the 4th row, even though I have the settings as windows per row 5-10 (min-max), and rows of windows to be 3. (see screenshot bellow)
  2. The list shows 2 windows of Finder. Those are tabs in one window, though. And I do have even more tabs (which are not showed by AltTab). If this is the normal/expected behavior then please ignore.

2020-04-20 at 9 53 AM

@lwouis
Copy link
Owner

lwouis commented Apr 20, 2020

Hey @ngocphamm :)

The list has a scroll bar, and there is actually the 4th row, even though I have the settings as windows per row 5-10 (min-max), and rows of windows to be 3. (see screenshot bellow)

Rows of windows means that the UI takes the vertical space of N rows. If your N rows are full it will make more rows which you can reach by scrolling. In your screenshot AltTab is indeed showing you 3 rows at a time, as you set.

Regarding the fact that there are 4 columns. This is a bug. It should be between 5 and 10 per your preferences. I was able to reproduce locally. It's happening because all your windows are fullscreen, which means the thumbnails have maximal width, and I'm guessing there is a rounding issue where the layout algo is not managing to feat the 5th thumbnail on the first row because it's overflowing by 1 pixel or something. I can see that as soon as I reduce the width of one of the window a little bit suddently there are 5 thumbnails on the first row.

I'll check and try to fix this issue. Btw the layout code was a nightmare to write because of all the complex corner-cases with tall/wide windows, and the flexibility of all the sliders interacting with each other. If you wanna dig in and rewrite the logic, feel free hehe ;p

The list shows 2 windows of Finder. Those are tabs in one window, though. And I do have even more tabs (which are not showed by AltTab). If this is the normal/expected behavior then please ignore.

This is actually the way macOS works at a technical levels: if you build you app using the built-in tab system, it will combine windows into tabs. Try drag-and-dropping a Finder/Terminal window by grabbing their tab bar. You will see them morph and when you drop, join the tabs of the other windows. They still stay 2 NSWindow objects though.

I don't think there is any way (at list without using private APIs) for us to know that windows are part of a group tabbed together. It's an interesting topic actually. I think some people would want AltTab to show tabs separately, and some would want to see only 1 which holds all tabs. I'll open another dedicated ticket to discuss this. It's interesting. Note that we could never "break down" the tabs of an app using custom tabs, like Chrome. Chrome is making their own tabs using custom UI within 1 window. At least the other way around may be possible by grouping standard tabs within the main window holding the tabs.

@ngocphamm
Copy link
Author

Hey @lwouis. Thanks for the quick response as always! I see "issues" now and I understand that it's not something totally easy to fix so I'm just glad we are aware of the situation. These are totall not a big deal at all.

For the rows one, I was under the impression that because I don't have 3*10 yet(3 rows, max 10 windows per row), I shouldn't see the 4th row, and the scrollbar, but I think what you said make sense. The only thing now is that the scrollbar doesn't seem to be scrollable using the scrollwheel of my mouse. It's fine with the 2-finger scroll gesture using the laptop's trackpad, though. 🤔

And I'm not familiar with Swift at all, but I will try to see if I can dig into the logic of calculating thumbnail width there. No promise though because I'm also not good at math 😅

For the Finder tabs issue, what caught my attention was that I have more than 2 tabs and only 2 get showed, so it's a little weird. I also tried to focus on another tab, and the 2 original tabs are still showed. However, as you said, it's probably some limitation we have to cope with for now because of the way those tabs/windows are managed from the lower level.

Anyway, thanks for taking your time to look into those concerns of mine. I really appreciate your great work!

@lwouis
Copy link
Owner

lwouis commented Apr 20, 2020

The only thing now is that the scrollbar doesn't seem to be scrollable using the scrollwheel of my mouse. It's fine with the 2-finger scroll gesture using the laptop's trackpad, though. 🤔

Could you open a separate ticket for this? I'm intrigued as I never tested with a mouse indeed. Since confinement started I've been stuck home with the trackpad.

For the Finder tabs issue, what caught my attention was that I have more than 2 tabs and only 2 get showed, so it's a little weird.

Actually I remember now. If you start AltTab after you already have the tabbed-together-windows, it will show 1, but if you start AltTab then make 2 windows and tab them together, then you see 2. I think it's because the accessibility API returns only 1 window if you ask for the app windows, but since we asked earlier and there were 2, we still have them, and we never get an event when they get merged.

This is great new, it means we have a clear path if we want to implement "show tabs as 1 windows" in #258! :)

@ngocphamm
Copy link
Author

ngocphamm commented Apr 20, 2020

Will make another ticket for scrollbar not scrollable with mouse issue.

However, now I realized that shouldn't it try to show me from 5 to 10 windows per row, for 3 rows, before showing the 4th row? Here I definitely don't have 30 windows yet to fill up all 3 rows with my current settings for number of windows per row, and number of rows to show. 🤔

@lwouis
Copy link
Owner

lwouis commented Apr 20, 2020

Good news, I found the "rounding error" in the layout code. It was indeed a by-5-pixel calculation issue. I'll push the fix soon (with other tickets; I don't want to spam users with updates).

However, now I realized that shouldn't it try to show me from 5 to 10 windows per row, for 3 rows, before showing the 4th row? Here I definitely don't have 30 windows yet to fill up all 3 rows with my current settings for number of windows per row, and number of rows to show. 🤔

I think the wording Min windows per row is getting you confused. Let me explain. It's quite a complex layout system I had to make.

Thumbnails have fixed height. This height depends on 2 values: Max size on screen and Rows of windows. Let's say you want the UI to cover 60% of the screen, and you want that the UI has capacity for 3 rows before you need to scroll. Then if you screen was 100px tall, you would have: 100 * 0.6 / 3 = 20px for each row.

Now for the thumbnails width, it's more complex because within that fixed 20px height, we need to find a width that shows tall and wide windows nicely. Imagine you have a window which is 10px high but 1000px wide. Or vice-versa. We have to decide a limit for these. We can't show a thumbnail that's suuuuper wide, and takes up a whole row. Windows 10 is kind of lacking imo on that. When I studied how they do it, I notice they stretch the thumbnail quite a lot, which I disagree with. Another issue is that for very tall and thin thumbnail, we would not show much of the title, which is important. You want to have some kind of minimum width for tall windows, so there is some text readable by the user.

So there is a minimum width so the text is readable with tall thumbnails, and a maximum width so the wide thumbnails don't take up too much horizontal space. This is why there are 2 settings for Min and Max windows per row.

I hope this explanation helps. It took me 2 iterations over v2 and v3 to come up with this design which I think deals smartly with all the possible cases.

@ngocphamm
Copy link
Author

I think I start to understand this now. So the min and max there are after the consideration of the complex calculation for the thumbnal size for each window. This is only throwing me off because I seem to have many maximized, and fullscreen windows. Due to that, I seem to always have rows with only 5 window thumbnails, and that's when the 4th row kicks in. If I have more smaller windows, I will start to see > 5 (and should be < 10) window thumbnails per row.

I think you are doing a really good job on that! Thank you!

@lwouis lwouis added bug Something isn't working duplicate This issue or pull request already exists labels Apr 20, 2020
@lwouis
Copy link
Owner

lwouis commented Apr 20, 2020

I'll close this ticket as we now have 2 other tickets to follow specific issues: #259 and #258

@lwouis lwouis closed this as completed Apr 20, 2020
lwouis pushed a commit that referenced this issue Apr 21, 2020
# [3.13.0](v3.12.0...v3.13.0) (2020-04-21)

### Bug Fixes

* showed rows with 1 too-few windows sometimes (see [#256](#256)) ([0eac086](0eac086))

### Features

* add hungarian localization ([ba7b5d3](ba7b5d3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants