! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Xfce panel blocks autohide when Idle source is running
Status:
RESOLVED: INVALID
Product:
Xfce4-panel

Comments

Description Tal 2011-11-14 12:33:07 CET
I'm writing a plugin for Xfce 4.8, which is internal, and notice that when I add source event by Idle, which run forever, Xfce panel autohide is blocked.
When I remove this idle source or returning false(to stop event), the panel isn't blocked.
This doesn't happen for external plugin/wrapper process.
But I still wonder- how does the "CPU Graph" plugin keep being updated without blocking autohide, and it's an internal plugin.

Thanks,
Tal
Comment 1 Nick Schermer editbugs 2011-11-15 09:07:53 CET
A lot of plugins use idles or timeouts, so I doubt that is related.
Comment 2 Tal 2011-11-17 09:08:35 CET
(In reply to comment #1)

I tested it using Vala programming language.
I had 2 panels in my DE, one autohides and one always shown.
First, it only happen for me when I set the X-XFCE-Internal set to true.
Second, I've removed/commented code to display a simple label to test the behaviour.
When there's a simple label in panel (internal)plugin, autohide was fine.
When I add this:
Idle.add (() => {
return true;
});
Then it blocks autohide of one of the panels.
Just to make sure, when I remove this code it doesn't block.
Did you find the problem here?
I'll try to send an example(I'll try in C), but now it's not a convinient time for me.

> A lot of plugins use idles or timeouts, so I doubt that is related.
I don't understand how other plugins work fine.
Comment 3 Nick Schermer editbugs 2011-11-17 11:28:29 CET
That idle will run forever.
Comment 4 Tal 2011-11-17 11:55:59 CET
> That idle will run forever.
Yes, this is the idea.
I know you think that this code I gave above is pointless, and in fact, you're right.
I use a different idle function to update labels, buttons, etc. That SHOULD run forever(until the plugin is dead- I know I need to take care of it manually).
I just tried to simplify my method so I can absolutely point the bug to Xfce panel, and not my panel plugin.
As I said before removing this line doesn't occur this bug, so this is why I reported this bug.
Again, I don't understand how other panel plugins use(probably) infinite Idle method without facing this bug.
If you give me a sample code that is internal plugin, using forever Idle function, I could see it's not bug with Xfce panel and somehow with my plugin.
Thanks,
Tal
Comment 5 Nick Schermer editbugs 2011-11-17 12:05:29 CET
Nobody runs an idle forever. I've no idea what you try to accomplish, but this will indeed block other idles with a lower priority.
Comment 6 Tal 2011-11-17 12:48:29 CET
(In reply to comment #5)
> Nobody runs an idle forever.
For example, how does CPU Graph plugin can refresh stats to display in widgets?

> I've no idea what you try to accomplish, but this
> will indeed block other idles with a lower priority.
My panel plugin is called MPRIS Plugin.
For example, if a player is changing status from paused into playing, I need to switch the "pause" button into "play" button, like every media player.
Signals are supported in MPRIS(as alternative for using Idle), but many players don't respect it and I need a manual check.
Theoretically I could use Timeout, but it doesn't seems appropriate.
Comment 7 Nick Schermer editbugs 2011-11-17 15:39:13 CET
Well what ever the solution is, this plugin is going to use 100% cpu (or at least a lot) and I can guarantee you a lot of people will complain. So I suggest to use signals, because that's the only proper solution.
Comment 8 Tal 2011-11-19 20:55:28 CET
(In reply to comment #7)
> Well what ever the solution is, this plugin is going to use 100% cpu (or at
> least a lot) and I can guarantee you a lot of people will complain. So I
> suggest to use signals, because that's the only proper solution.

I don't understand- does using infinite non-blocking Idle event source in DEFAULT_IDLE priority, which I guess CPU Graph uses it too, is a bad idea that is heavy for CPU?
What solution do you suggest me?
I don't believe CPU Graph(and many other internal plugins) solve this problem by using Timeout or signals.
Comment 10 Tal 2011-11-24 14:38:47 CET
(In reply to comment #9)
> They do:
> http://git.xfce.org/panel-plugins/xfce4-cpugraph-plugin/tree/panel-plugin/cpu.c#n403

I find another fix for it. Just use Priority.LOW in Idle.
However, I still think my bug request make sense, since infinite Idle shouldn't block background tasks.

Thanks,
Tal

Bug #8146

Reported by:
Tal
Reported on: 2011-11-14
Last modified on: 2011-11-24

People

Assignee:
Nick Schermer
CC List:
0 users

Version

Attachments

Additional information