Robert Shearman rob@codeweavers.com writes:
ev.xclient.type = ClientMessage;
ev.xclient.window = systray_window;
ev.xclient.message_type = x11drv_atom(_NET_SYSTEM_TRAY_OPCODE);
ev.xclient.format = 32;
ev.xclient.data.l[0] = CurrentTime;
ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK;
ev.xclient.data.l[2] = data->whole_window;
XSendEvent( display, systray_window, False, NoEventMask, &ev );
XSync( display, False );
You need to get the tsx11 lock when calling X functions. Also what's the reason for having an XSync here?
Alexandre Julliard wrote:
Robert Shearman rob@codeweavers.com writes:
ev.xclient.type = ClientMessage;
ev.xclient.window = systray_window;
ev.xclient.message_type = x11drv_atom(_NET_SYSTEM_TRAY_OPCODE);
ev.xclient.format = 32;
ev.xclient.data.l[0] = CurrentTime;
ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK;
ev.xclient.data.l[2] = data->whole_window;
XSendEvent( display, systray_window, False, NoEventMask, &ev );
XSync( display, False );
You need to get the tsx11 lock when calling X functions. Also what's the reason for having an XSync here?
I've added the locking. The XSync is needed because without it the systray window ends up with a width of 1. I don't understand why this is happening. What debug channels would be good to turn on to investigate this?
Robert Shearman rob@codeweavers.com writes:
I've added the locking. The XSync is needed because without it the systray window ends up with a width of 1. I don't understand why this is happening. What debug channels would be good to turn on to investigate this?
Probably +event and check for ConfigureNotify and that sort of things.
Adding the locking fixes the problem about icons not docking properly that I described in one of my posts yesterday. It's much better now.
James
On Wed, 2005-09-21 at 13:58 -0500, Robert Shearman wrote:
Alexandre Julliard wrote:
Robert Shearman rob@codeweavers.com writes:
ev.xclient.type = ClientMessage;
ev.xclient.window = systray_window;
ev.xclient.message_type = x11drv_atom(_NET_SYSTEM_TRAY_OPCODE);
ev.xclient.format = 32;
ev.xclient.data.l[0] = CurrentTime;
ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK;
ev.xclient.data.l[2] = data->whole_window;
XSendEvent( display, systray_window, False, NoEventMask, &ev );
XSync( display, False );
You need to get the tsx11 lock when calling X functions. Also what's the reason for having an XSync here?
I've added the locking. The XSync is needed because without it the systray window ends up with a width of 1. I don't understand why this is happening. What debug channels would be good to turn on to investigate this?
On Wed, 2005-09-21 at 12:07 +0200, Alexandre Julliard wrote:
Also what's the reason for having an XSync here?
The XSync call is in the example on freedeskotop.org for showing how to send client messages (http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html#me...) uses an XSync call after the message is sent. If I had to guess, I would say this was to make sure that: 1. The sent message gets processed properly, and 2. That sending the message doesn't interfere with any other message processing that would be involved with reparenting the window as required by the freedesktop systray protocol.
By using XSync, Rob was following the example pretty much to the letter, which was probably a really good idea. Hope this answers your question.
James