aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaX11.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-04-20 10:47:57 -0400
committerKen Moore <ken@pcbsd.org>2015-04-20 10:47:57 -0400
commit570272ccbe285afcad3f5b4ab00a18475ef163ed (patch)
tree09c4ac5e4440d61453d62de843afc19f5af312d4 /libLumina/LuminaX11.cpp
parentMerge pull request #91 from Nanolx/lumina-panel-date (diff)
downloadlumina-570272ccbe285afcad3f5b4ab00a18475ef163ed.tar.gz
lumina-570272ccbe285afcad3f5b4ab00a18475ef163ed.tar.bz2
lumina-570272ccbe285afcad3f5b4ab00a18475ef163ed.zip
Remove the last libX11 usage in the sytem tray protocols. Move the damage ID creation to XCB, and place it within the embedding routine in LuminaX11 instead.
Diffstat (limited to 'libLumina/LuminaX11.cpp')
-rw-r--r--libLumina/LuminaX11.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp
index 05a03631..89c138ca 100644
--- a/libLumina/LuminaX11.cpp
+++ b/libLumina/LuminaX11.cpp
@@ -27,6 +27,7 @@
#include <xcb/xcb_icccm.h>
#include <xcb/xcb_image.h>
#include <xcb/composite.h>
+#include <xcb/damage.h>
//===== WindowList() ========
@@ -1357,15 +1358,16 @@ void LXCB::MoveResizeWindow(WId win, QRect geom){
}
// === EmbedWindow() ===
-bool LXCB::EmbedWindow(WId win, WId container){
- if(win==0 || container==0){ return false; }
+uint LXCB::EmbedWindow(WId win, WId container){
+ //This returns the damage control ID number (or 0 for a failure)
+ if(win==0 || container==0){ return 0; }
//qDebug() << "Embed Window:" << win << container;
//Initialize any atoms that will be needed
xcb_intern_atom_cookie_t ecookie = xcb_intern_atom_unchecked(QX11Info::connection(), 0, 7, "_XEMBED");
xcb_intern_atom_reply_t *ereply = xcb_intern_atom_reply(QX11Info::connection(), ecookie, NULL);
- if(ereply==0){ return false; } //unable to initialize the atom
+ if(ereply==0){ return 0; } //unable to initialize the atom
xcb_atom_t emb = ereply->atom;
free(ereply); //done with this structure
@@ -1399,8 +1401,12 @@ bool LXCB::EmbedWindow(WId win, WId container){
//Now map the window (will be a transparent child of the container)
xcb_map_window(QX11Info::connection(), win);
+ //Now create/register the damage handler
+ xcb_damage_damage_t dmgID = xcb_generate_id(QX11Info::connection()); //This is a typedef for a 32-bit unsigned integer
+ xcb_damage_create(QX11Info::connection(), dmgID, win, XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES);
+
//qDebug() << " - Done";
- return true;
+ return ( (uint) dmgID );
}
// === Unembed Window() ===
bgstack15