G-dH / vertical-workspaces

V-Shell is a GNOME Shell extension that allows you to customize the layout and behavior of the Shell UI.
GNU General Public License v3.0
229 stars 19 forks source link

[BUG] Grid calculation / apps sorting issue #160

Closed meybonomme closed 2 months ago

meybonomme commented 4 months ago

Fedora 40, GNOME 46.1, V-Shell from Github repo with all latest fixes.

With latest fixes seems that some grid calculation issues are already gone, that occurred after the App Grid part was rewritten.

I have laptop with 1920x1080 display and 100% scaling plus external monitor with 2560x1440 display and 125% scaling. My V-Shell settings are 8 columns per page, rows per page is adaptive. With laptop internal screen I have 8x4 grid and with external monitor 8x5 grid. Considering screen sizes and scaling, both are perfectly good, but...

My apps sorting setting is "Custom (Default)" but for clarity, the apps are manually arranged in alphabetical order. With external monitor are my apps on two pages, this is my second/last page of App Grid:

Screenshot from 2024-05-22 01-57-41

After restart or relogin I got often (but not always) with external monitor following result:

Screenshot from 2024-05-22 02-00-42

App Grid is calculated correctly for this display (8x5) but the order of apps is messed up. If I will now reload my V-Shell profile (sometimes twice) apps order gets back to normal.

I usually have my laptop lid closed and only use an external display. But if I will disconnect external monitor, I got following result:

Screenshot from 2024-05-22 02-06-45

App Grid is calculated 8x4, which is perfectly fine, butt apps order is messed up again. The difference is that with an internal screen reloading V-Shell profile, relogin or restart doesn't help, apps order stays wrong. Maybe it's because the application order and V-Shell settings are set using an external display.

meybonomme commented 4 months ago

Using only an external display, this is what I got today after waking the laptop from sleep mode:

Screenshot from 2024-05-22 20-04-33

Before sleep, everything was fine, the App Grid was 8x5, as it should be. When I reloaded my V-Shell profile, the app grid was correctly calculated as 8x5, but the apps order was messed up. When I reloaded my V-Shell profile again, the order of applications was also correct.

This has happened before, but in the meantime I updated V-Shell and the problem was gone for a few days.

G-dH commented 4 months ago

When the wrong sorting happens, can you try executing the following line from the Looking Glass to see if it helps?

Main.overview._overview.controls._appDisplay._updateIconPositions()
meybonomme commented 4 months ago

This is the only output and nothing changes:

Screenshot from 2024-05-24 20-25-21

G-dH commented 4 months ago

Execute this

Main.overview._overview.controls._appDisplay._orderedItems.forEach(i => print(i.id))

and let me know whether the order is also messed up there. You'll find the output in the log.

Then you can try:

Main.overview._overview.controls._appDisplay._redisplay()

All needs to be done while the app grid is open and visible.

meybonomme commented 4 months ago

If grid calculation is wrong (8x4 app grid instead of 8x5 on external monitor), these commands doesn't change anything. Reloading my V-Shell profile helps, but apps order now messed up.

When I run the command Main.overview._overview.controls._appDisplay._orderedItems.forEach(i => print(i.id)) nothing visible happens.

Main.overview._overview.controls._appDisplay._redisplay() after that corrects apps order.

meybonomme commented 4 months ago

Today after the reboot I got 8x3 grid with using only external display:

Screenshot from 2024-05-28 14-45-08

G-dH commented 4 months ago

With the custom order setting, each icon has its own page/position properties for the grid dimensions current in the time the data was stored. When you change the grid's dimensions, these data doesn't change, and icons that don't fit are redistributed according to the current configuration.

I can fix it for disabled Allow Incomplete Pages option.

meybonomme commented 4 months ago

I can fix it for disabled Allow Incomplete Pages option.

Very good, because I have this option disabled. But the main problem is why the grid is very often calculated incorrectly.

G-dH commented 3 months ago

Please, test the latest update.

meybonomme commented 3 months ago

Thank you, I will test the update for a few days and then give feedback.

meybonomme commented 3 months ago

Using only an external display, I've gotten the result in the screenshot several times. The vertical alignment is wrong, the pages are incomplete, and the order of the applications is not correct. This has happened after the screen has gone blank, the screen has locked, or the computer has been woken from sleep.

This seems to be the only bug at the moment based on my testing.

Screenshot from 2024-06-08 11-50-13

G-dH commented 3 months ago

Thanks!

meybonomme commented 3 months ago

Today after restarting the computer I saw such a picture. Restarting V-Shell helped, reloading the profile did not.

Screenshot from 2024-06-10 13-16-08

G-dH commented 3 months ago

Have you installed yesterday's update?

meybonomme commented 3 months ago

Have you installed yesterday's update?

Yes.

G-dH commented 3 months ago

Was the external monitor involved?

meybonomme commented 3 months ago

Yes, I only used the external monitor when I restarted the computer. The laptop lid was closed and the built-in display was off.

G-dH commented 3 months ago

Try to reproduce the issue and then execute the following line from lg: Main.overview._overview.controls._appDisplay._redisplay()

G-dH commented 3 months ago

I believe that the latest refactored version of _redisplay() can handle any situation. I'm starting to understand the details of how the app grid works. I also sort of fixed keyboard navigation inside app folders and some other upstream glitches.

meybonomme commented 3 months ago

Excellent! I will test the updates and then give feedback.

meybonomme commented 3 months ago

With the laptop lid closed and only using an external monitor, I got an 8x4 app grid today after waking the computer from sleep. 8x4 is the correct grid for a laptop monitor. Everything was fine before I went to sleep, the app grid was 8x5 on the external monitor.

There are also problems with dragging icons out of the folder. Sometimes when just dragging an icon out of a folder, this happens:

Screenshot from 2024-06-13 13-02-10

When I drag an icon to another page of the app grid (for example, a folder is on the first page and I want to drag it to the second page), I often get something like this (switching app grid pages will fix this problem):

Screenshot from 2024-06-13 02-11-58

Then another older bug, I've always forgotten to report this one. After dragging the icon out of the folder, this is what happens most of the time (reloading V-Shell profile fixes this):

Screenshot from 2024-06-13 02-10-35

G-dH commented 3 months ago

In the default app grid, this happens anytime you start dragging and there is a selected item on another page. I've fixed it partially, but the folder part needs more work. The last screenshot also shows an upstream bug. I'll try to fix it for V-Shell, but you should report it here: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6164

G-dH commented 3 months ago

Another update for testing.

meybonomme commented 3 months ago

The main problems with grid calculation and app sorting seem to be gone, well done! So far, I have not been able to create a situation where the grid is calculated incorrectly or the order of applications is incorrect for either monitor.

Most of the time when I switch monitors, restart the computer, or wake up from sleep, the first time I open the app grid, I see an animation as the app grid is recalculated and the app icons are moved. In one case, it was not quite successful:

Screenshot from 2024-06-16 21-58-07

It seems that you have also successfully fixed the upstream folder bug, because it has no longer occurred when dragging the icons out of the folder. Good job!

Unfortunately, when I drag the icons out of the folder, the app grid bug is still there and I get the following results:

Screenshot from 2024-06-15 16-23-43

Screenshot from 2024-06-15 01-29-30

Screenshot from 2024-06-16 22-39-40

I have "Center Open Folders" option enabled and with external monitor all is fine:

Screenshot from 2024-06-16 22-08-25

With the laptop's built-in monitor, the vertical alignment of the same folder is incorrect:

Screenshot from 2024-06-16 21-56-30

G-dH commented 3 months ago

Thanks. The centering of folders is OK, it looks better to me when a smaller folder is closer to the top edge rather than in the center.

G-dH commented 3 months ago

But the DND from the folder should be fixed, I'm unable to reproduce the bug anymore.

meybonomme commented 3 months ago

Thanks. The centering of folders is OK, it looks better to me when a smaller folder is closer to the top edge rather than in the center.

I agree about the small folders, but the screenshots have full-height folders for each monitor. If the app grid is vertically centered, full-height folders should be as well for a nicer, more consistent design. The current solution seems a bit out of place to me.

meybonomme commented 3 months ago

But the DND from the folder should be fixed, I'm unable to reproduce the bug anymore.

Yes, as I said in my previous post :wink:

It seems that you have also successfully fixed the upstream folder bug, because it has no longer occurred when dragging the icons out of the folder. Good job!

G-dH commented 3 months ago

Unfortunately, when I drag the icons out of the folder, the app grid bug is still there and I get the following results:

?

G-dH commented 3 months ago

Btw, the vertical position for all folders is calculated the same way: 1/3 of the free space on top and 2/3 on the bottom.

meybonomme commented 3 months ago

Unfortunately, when I drag the icons out of the folder, the app grid bug is still there and I get the following results:

?

I meant this upstream bug, it's gone:

Screenshot from 2024-06-13 02-10-35

G-dH commented 3 months ago

I know. I'm responding to this:

Unfortunately, when I drag the icons out of the folder, the app grid bug is still there and I get the following results:

meybonomme commented 3 months ago

I know. I'm responding to this:

Unfortunately, when I drag the icons out of the folder, the app grid bug is still there and I get the following results:

Yes, for some reason I get one of the results shown in the screenshots every time I drag the icon out of the folder.

G-dH commented 3 months ago

In the default shell, this issue has one condition: an app icon is selected on a different page than where the open folder is located. This can happen when you select the icon using the keyboard, then switch to a different page, open the folder using the mouse, and drag-and-drop an icon out of the folder. V-Shell now overrides the selection upon opening the folder and selects the folder icon to prevent this issue.

meybonomme commented 3 months ago

I only used the mouse/touchpad to navigate the app grid and drag icons out of the folder during testing.

G-dH commented 3 months ago

OK, I was successful in reproducing the issue when I opened the folder with the keyboard. The problem appears to be that the app grid sometimes doesn't recognize which page is currently active despite the current selection. This becomes problematic when dragging the icon, as adjacent pages should move to partially overlap the current one.

G-dH commented 3 months ago

When migrating icons as you open the app grid, switching monitors causes the Shell to send various sizes to the app grid allocation method in a short period. V-Shell now responds to all these changes, but the final adjustments take effect when the app grid becomes visible.

G-dH commented 3 months ago

Could you please open a new issue for each of the app grid-related bugs that still need to be fixed?

meybonomme commented 3 months ago

I will test your brand new update and if necessary, I will open a new issue for each bug I found.