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
A lot of plugins use idles or timeouts, so I doubt that is related.
(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.
That idle will run forever.
> 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
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.
(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.
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.
(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.
They do: http://git.xfce.org/panel-plugins/xfce4-cpugraph-plugin/tree/panel-plugin/cpu.c#n403
(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