Opened 4 years ago

Last modified 5 months ago

#3419 new bug

UI Does Not Retain Positioning

Reported by: davidhart Owned by:
Priority: minor Milestone: 2.0.6
Component: GTK UI Version: 2.0.3
Keywords: Cc:

Description

This is not a critical issue.

When opening deluge the bottom panel is extremely short; displaying only the first two lines of Status.

The expectation is that, if I raise the panel to show every item in the menu, from Status to Stats, the positioning will be retained.

On a new session Deluge reverts back to the very short panel.

Distro=Fedora 32

Desktop=KDE plasma

Package via RPM

Packages installed: deluge-2.0.3-7.fc32.noarch

deluge-console-2.0.3-7.fc32.noarch

deluge-images-2.0.3-7.fc32.noarch

deluge-daemon-2.0.3-7.fc32.noarch

deluge-gtk-2.0.3-7.fc32.noarch

deluge-common-2.0.3-7.fc32.noarch

deluge-web-2.0.3-7.fc32.noarch

Command line=deluge-gtk (same result with simply deluge)

Toy=Intel i7 based Dell laptop

Attachments (2)

Screenshot_20200802_152027.jpg (29.5 KB) - added by davidhart 4 years ago.
test_paned.py (1.9 KB) - added by Cas 3 years ago.

Download all attachments as: .zip

Change History (15)

Changed 4 years ago by davidhart

comment:1 Changed 3 years ago by MotoFckr9k

Same issue here on Linux mint 19.3 with Cinnamon This is fairly new and hasn't been happening in the latest 1.x.x version.

comment:2 follow-up: Changed 3 years ago by Cas

I am not seeing any issue on Ubuntu but I can see your system is KDE based.

What is the config value for tabsbar_position? Check with:

grep tabsbar_position ~/.config/deluge/*.conf
> ~/.config/deluge/gtk3ui.conf:    "tabsbar_position": 367,

Is the config value changing/updating when closing?

comment:3 in reply to: ↑ 2 Changed 3 years ago by MotoFckr9k

Replying to Cas:

I am not seeing any issue on Ubuntu but I can see your system is KDE based.

What is the config value for tabsbar_position? Check with:

grep tabsbar_position ~/.config/deluge/*.conf
> ~/.config/deluge/gtk3ui.conf:    "tabsbar_position": 367,

Is the config value changing/updating when closing?

On my system it is changing live and stays right when closing and even when opening, but the bottom panel still "resets". It seems to just not abide to that value.

comment:4 follow-up: Changed 3 years ago by Cas

Will need a lot more information to determine if this is a Deluge or GTK on KDE issue.

  • What actual values are you seeing? Note the pixel values are the Torrent view height to the Tab bar.
  • How do the value compare to the window size?
  • Does the sidebar retain it's position? It is configured in the same way as the Tab bar

Changed 3 years ago by Cas

comment:5 Changed 3 years ago by Cas

I have attached a demo Gtk app with paned setup as per Deluge, can you test if this works. Run it from console with python3 test_paned.py

comment:6 in reply to: ↑ 4 Changed 3 years ago by MotoFckr9k

Replying to Cas:

Will need a lot more information to determine if this is a Deluge or GTK on KDE issue.

Keep in mind that this is *not* on KDE. I am a different person than the one that originally opened the issue. I am on Cinnamon which is much closer to Gnome than KDE.

  • What actual values are you seeing? Note the pixel values are the Torrent view height to the Tab bar.

In my case the value makes sense in relation to the window and monitor resolution. "1086" is what would be ideal for me and I can set it to that as well.

  • How do the value compare to the window size?

The value gets affected by the window size. Making the window very small lowers the value accordingly.

  • Does the sidebar retain it's position? It is configured in the same way as the Tab bar

The sidebar *does* actually retain its position and doesn't seem affected by the same issue.

The test_paned.py demo app works fine. (Except for the side tab which doesn't seem implemented) Reopening the app retains the new tab bar position every time.

comment:7 Changed 3 years ago by MotoFckr9k

Update: Apparently the issue isn't 100% reliable. Right after doing that last test, I tried to see if it was related to the window being maximized. It seems to be related *somehow*.

When resizing the tab bar in a non-maximized window, it retains it position fine. If I then maximize the window again, restarting seems to walk the tab bar down in steps that seem to depend on the difference between the maximized and the non-maximized window.

Maybe Deluge is being started as a non-maximized window, then immediately maximized by the window manager and then over-compensates for being maximized? Just talking out of my ass here.

comment:8 follow-up: Changed 3 years ago by Cas

  • Milestone changed from needs verified to 2.0.4

Thanks for the updates, I think you are right that the maximizing of the window is having an effect here. I can replicate by maximizing the window, adjust the tab bar height then close and reopen Deluge to find the tab bar height at it's minimum.

I also notice that the maximized state is not stored correctly such that unmaximizing and closing restores it maximized. Retaining the window size and position is such a pain!

comment:9 in reply to: ↑ 8 Changed 3 years ago by MotoFckr9k

Replying to Cas:

I also notice that the maximized state is not stored correctly such that unmaximizing and closing restores it maximized.

In my case it seems to only store the unmaximization if the unmaximized window size is significantly smaller than the maximized size.

comment:10 Changed 3 years ago by Cas

After narrowing down the problem, it is a Gtk bug specifically when restoring maximized application the paned tabbar position is reset. The related issue:

https://gitlab.gnome.org/GNOME/gtk/-/issues/1959

There might be a workaround for Deluge to implement but will need to look into it further

comment:11 Changed 2 years ago by Cas

  • Milestone changed from 2.0.4 to 2.0.5

Ticket retargeted after milestone closed

comment:12 Changed 2 years ago by Cas

  • Milestone changed from 2.0.5 to 2.0.6

Ticket retargeted after milestone closed

comment:13 Changed 5 months ago by ethangrinnell78

I made my own work around for this that does the job, but isn't pretty. I wanted to prevent position changes of tabsbar and sidebar from being saved until the window is visible and active. Once they are both true I set the initial positions for the tabsbar and sidebar and unlock those configuration values.

I noticed that the mainwindow.py visible() function is periodically called by something. So I modified that function to set a flag when the window becomes visible and active and set the positions of tabsbar and sidebar. When that flag is set and the tabsbar or the sidebar are moved the new positions can be written to the config file. I'm sure there is a better way to accomplish this.

Here are the changes that I made to mainwindow.py:

In class MainWindow:

__init__() added self.visible_and_active = False
first_show() added self.visible_and_active = False

def visible(self):
    """Returns True if window is visible, False if not."""
    if not self.visible_and_active and self.window.get_visible() and self.window.is_active():
        self.visible_and_active = True
        self.sidebar_pane.set_position(self.config['sidebar_position'])
        self.tabsbar_pane.set_position(self.config['tabsbar_position'])
    return self.window.get_visible()

def on_tabsbar_pane_position_event(self, obj, param):
    if (self.visible_and_active):
        self.config['tabsbar_position'] = self.tabsbar_pane.get_position()

def on_sidebar_pane_position_event(self, obj, param):
    if (self.visible_and_active):
        self.config['sidebar_position'] = self.sidebar_pane.get_position()
Last edited 5 months ago by ethangrinnell78 (previous) (diff)
Note: See TracTickets for help on using tickets.