- // SDL/X11 stuff we save for faster access.
- Display* display;
- Window window;
-
- // Shared memory segment info.
- key_t shmkey;
- int shmid;
- void *shmaddr;
-
-private:
- /** Sends a message to hildon-desktop.
- * This function comes mostly straight from libhildon.
- */
- void sendMessage(Atom message_type,
- uint32 l0, uint32 l1, uint32 l2, uint32 l3, uint32 l4)
- {
- XEvent event = { 0 };
-
- event.xclient.type = ClientMessage;
- event.xclient.window = window;
- event.xclient.message_type = message_type;
- event.xclient.format = 32;
- event.xclient.data.l[0] = l0;
- event.xclient.data.l[1] = l1;
- event.xclient.data.l[2] = l2;
- event.xclient.data.l[3] = l3;
- event.xclient.data.l[4] = l4;
-
- XSendEvent (display, window, True,
- StructureNotifyMask,
- (XEvent *)&event);
- }
-
- /** Sends all configuration parameters for the remote texture. */
- void reconfigure()
- {
- Window parent;
- int yoffset = 0;
- if (Config.fullscreen) {
- parent = WMinfo.info.x11.fswindow;
- } else {
- parent = WMinfo.info.x11.wmwindow;
- yoffset = 60; // Hardcode the title bar size for now.
- }
-
- sendMessage(HDATOM(_HILDON_TEXTURE_CLIENT_MESSAGE_SHM),
- (uint32) shmkey, m_w, m_h, m_Bpp, 0);
- sendMessage(HDATOM(_HILDON_TEXTURE_CLIENT_MESSAGE_PARENT),
- (uint32) parent, 0, 0, 0, 0);
- sendMessage(HDATOM(_HILDON_TEXTURE_CLIENT_MESSAGE_POSITION),
- m_area.x, yoffset + m_area.y, m_area.w, m_area.h, 0);
- sendMessage(HDATOM(_HILDON_TEXTURE_CLIENT_MESSAGE_SCALE),
- ratio_x * (1 << 16), ratio_y * (1 << 16), 0, 0, 0);
- sendMessage(HDATOM(_HILDON_TEXTURE_CLIENT_MESSAGE_SHOW),
- 1, 255, 0, 0, 0);
- }
-