Hi. I'm writing an xfce panel plugin in vala to embed the famous gnome DockBarX applet. Since it provides a desktop-agnostic gtk widget, I figured that it should be doable. Except that it's in python. I couldn't just write the entire plugin in python, because the python bindings for xfce are out of date. Since I don't know of any way to do interoperability between vala and python, I decided to use plugs and sockets to get it in there. The vala plugin provides the socket, and a little python program makes the plug. It worked! Except that it had a gray background, which was jarring considering the rest of the panel has a nice fading translucent gradient. I couldn't find any way to gracefully get rid of that, so I looked around and decided to fake it with an expose event. That worked! ...almost. When I started selecting different windows, the effect for the selected window stayed on the old one, and started cropping up as I went back and forth, resulting in this:

This behavior doesn't occur when I don't have the custom expose (in other words, with the gray background). I've been googling for entirely too long, and I am out of energy. I feel like I have scoured every corner of the internet for advice on what to do about this. I have no idea what to do to make this go away. Here's the python code for the plug, which does most of the work. Can anyone tell me what to do to fix this?

Hi. I'm the developer of DockbarX. I'm really glad to hear about your project and think perhaps I can help you with your problem. In line 65 (or somewhere around that line) of cairowidgets.py there's a line that says

Code:

self.area.window.clear_area(a.x, a.y, a.width, a.height)

Try replacing it with

Code:

self.area.window.clear_area_e(a.x, a.y, a.width, a.height)

and see if that helps.

If I understood correctly the clear_area command doesn't work when

Code:

self.window.set_back_pixmap(None, False)

is used and you use that in your do_expose function.

Do you have your code available anywhere? I'd like to include it in the next version (and perhaps use it to make a similar plug for the lxde panel) if that's ok with you.

Oh, hi there! It's me, the guy who ported Namebar to xfce4/vala. I was thinking about doing the same for DockBarX, but I really wanted the functionality ASAP, and it's waaay too big to consider porting while I'm both in school and working. So I decided to find a way to shove DockBarX into a plugin as-is. It's good to see you giving me a helping hand yet again! :D

I had actually found a way to get this working before you posted: by creating the dockbar with run_as_dock=True and adding the add_window and remove_window methods that it wanted in order to run that way. I didn't know why it worked that way at the time, but it did with the gotchas that I needed those two functions, and when I changed the theme, it wouldn't refresh. I probably needed to add more stuff to make the plug pretend to be dockx.

However, I like your way better, even though it requires modifying dockbarx code. When I went to make the change you suggested, I noticed that the reason my first solution worked is because when run_as_dock is True, it ends up using that function that you mentioned. Why isn't that used in all cases, if you don't mind me asking?

As for the availability of my code, not just yet. I still need to add some bits to get the plug to fake integration with the rest of the panel. Right now, it only loads my panel background and mine only. As soon as it's ready though, you'll definitely be the first to know, and I would be honored to have you include it. :D The only catch is that it needs the vala code that goes with it. I'd have just done it in python, but there are no updated bindings, and the ones in git only do 4.6 plugin emulation... which is basicallly plugs and sockets. The exact same thing I'm doing. Since vala bindings are more readily available and up-to-date, I decided to bridge the two.

I also updated xfce4-namebar-plugin to XFCE 4.8, though to be honest, I'd like to host it on Google Code instead of your Launchpad. The only reason why is because I don't like bzr at all. I prefer svn.

The reason clera_area is used instead of clear_area_e is that clear_area_e does some extra redrawing that isn't needed for the applet. I tried using clear_area_e for the gnome applet when making dockx but I either it was slower or showed some flicker, can't remember exactly what it was but I decided it was a bad idea to use it.

By the way did you ever try to set the background as the back_pixmap instead of using a do_expose function? I think that would be a more elegant solution if it works.

Yes, actually. It's mostly done, but I've just been really busy as of late, so I haven't been able to tweak on it and fix one of the last bugs left. It's not working quite right in non-composited environments at the moment, but once I get into finals week, I'll release this and the new xfce4-namebar-plugin with it.

Are you still working on this? Releasing half-finished code would be better than nothing... This is _the_ feature I would like to have in the next DockbarX release, which has been postponed for far too long now.

Who is online

Users browsing this forum: Google [Bot] and 6 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum