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

Inconsistent realign() and emit realigned() behavior? #7

Closed
PCMan opened this issue Nov 5, 2013 · 1 comment
Closed

Inconsistent realign() and emit realigned() behavior? #7

PCMan opened this issue Nov 5, 2013 · 1 comment

Comments

@PCMan
Copy link
Member

PCMan commented Nov 5, 2013

While trying to implement NETWM icon geometry for the task bar buttons, I noted that there is a problem.
In LxQtPanel, there are a lot of places emit realigned() is called, and in some places only realign() is called and the signal is not emitted. This caused some inconsistency.
When you setPosition() or setLength(), only "emit realigned()" is called, but the panel is not yet resized, so in Plugin::realign() the panel is still in its old geometry. However, in showEvent(), realigned() is trigerred after calling realign(), so when Plugin::realign() is called, the panel is already in its new geometry and that causes inconsistency.
What's the state of the panel when Plugin::realign() is called? prepared to resized and repositioned and have the old state, or it's already realigned?

What if I want to do something AFTER the panel is already realigned and its geometry is already changed? How can I ensure that?
I tried to install a timer in Plugin::realign() but that's not reliable since I'm not sure when will the panel really get its new state after realign() is called.

@rootzrich
Copy link
Contributor

Just did a PR for that. emit realigned is now called always AFTER LxQtPanel::realign().
The signal will call Plugin::realign() so you can be sure that everything is realigned when this function is called.
Hope that solves the problem!

rootzrich@adf99f0

@PCMan PCMan closed this as completed Jul 3, 2014
stefonarch added a commit to stefonarch/lxqt-panel that referenced this issue Dec 21, 2020
stefonarch added a commit to stefonarch/lxqt-panel that referenced this issue Dec 21, 2020
stefonarch added a commit that referenced this issue Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants