aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-09-20 11:52:41 -0400
committerKen Moore <ken@ixsystems.com>2017-09-20 11:52:41 -0400
commit5a3d2fb042e341be62864ffd1f06ad278514fd7d (patch)
tree9df0ccf96a67c14ada42b36155d07a776fd697e9
parentCleanup a bit more of the embed stuff. (diff)
downloadlumina-5a3d2fb042e341be62864ffd1f06ad278514fd7d.tar.gz
lumina-5a3d2fb042e341be62864ffd1f06ad278514fd7d.tar.bz2
lumina-5a3d2fb042e341be62864ffd1f06ad278514fd7d.zip
Get window type detection/usage all implemented.
Now the window frame will get disabled/ignored for particular types of windows.
-rw-r--r--src-qt5/core/libLumina/NativeWindowSystem.cpp22
-rw-r--r--src-qt5/core/libLumina/RootSubWindow.h1
-rw-r--r--src-qt5/core/libLumina/RootWindow.cpp2
3 files changed, 24 insertions, 1 deletions
diff --git a/src-qt5/core/libLumina/NativeWindowSystem.cpp b/src-qt5/core/libLumina/NativeWindowSystem.cpp
index 0ee65929..e8e9655a 100644
--- a/src-qt5/core/libLumina/NativeWindowSystem.cpp
+++ b/src-qt5/core/libLumina/NativeWindowSystem.cpp
@@ -492,7 +492,27 @@ void NativeWindowSystem::UpdateWindowProperties(NativeWindow* win, QList< Native
}
if(props.contains(NativeWindow::WinTypes)){
QList< NativeWindow::Type> types;
- types << NativeWindow::T_NORMAL; //make this load appropriately later
+ xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_window_type_unchecked(&obj->EWMH, win->id());
+ xcb_ewmh_get_atoms_reply_t reply;
+ if(1==xcb_ewmh_get_wm_window_type_reply(&obj->EWMH, cookie, &reply, NULL) ){
+ for(unsigned int i=0; i<reply.atoms_len; i++){
+ if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DESKTOP){ types << NativeWindow::T_DESKTOP; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DOCK){ types << NativeWindow::T_DOCK; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_TOOLBAR){ types << NativeWindow::T_TOOLBAR; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_MENU){ types << NativeWindow::T_MENU; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_UTILITY){ types << NativeWindow::T_UTILITY; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_SPLASH){ types << NativeWindow::T_SPLASH; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DIALOG){ types << NativeWindow::T_DIALOG; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DROPDOWN_MENU){ types << NativeWindow::T_DROPDOWN_MENU; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_POPUP_MENU){ types << NativeWindow::T_POPUP_MENU; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_TOOLTIP){ types << NativeWindow::T_TOOLTIP; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_NOTIFICATION){ types << NativeWindow::T_NOTIFICATION; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_COMBO){ types << NativeWindow::T_COMBO; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DND){ types << NativeWindow::T_DND; }
+ else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_NORMAL){ types << NativeWindow::T_NORMAL; }
+ }
+ }
+ if(types.isEmpty()){ types << NativeWindow::T_NORMAL; }
win->setProperty(NativeWindow::WinTypes, QVariant::fromValue< QList<NativeWindow::Type> >(types) );
}
}
diff --git a/src-qt5/core/libLumina/RootSubWindow.h b/src-qt5/core/libLumina/RootSubWindow.h
index 67798140..598298e2 100644
--- a/src-qt5/core/libLumina/RootSubWindow.h
+++ b/src-qt5/core/libLumina/RootSubWindow.h
@@ -66,6 +66,7 @@ private:
static QStringList validAnimations(NativeWindow::Property);
public slots:
+ void ensureVisible(){ WIN->setProperty(NativeWindow::Visible, true); }
void giveMouseFocus(){ WinWidget->raiseWindow(); }
void removeMouseFocus(){ WinWidget->lowerWindow(); }
void giveKeyboardFocus(){ WIN->requestProperty(NativeWindow::Active, true, true); }
diff --git a/src-qt5/core/libLumina/RootWindow.cpp b/src-qt5/core/libLumina/RootWindow.cpp
index fdbc1eb8..705297be 100644
--- a/src-qt5/core/libLumina/RootWindow.cpp
+++ b/src-qt5/core/libLumina/RootWindow.cpp
@@ -239,7 +239,9 @@ void RootWindow::NewWindow(NativeWindow *win){
connect(subwin, SIGNAL(windowAnimFinished()), this, SLOT(checkMouseFocus()) );
WINDOWS << subwin;
}
+ //QApplication::processEvents();
CheckWindowPosition(win->id(), true); //first-time run
+ //QTimer::singleShot(300, subwin, SLOT(ensureVisible()));
win->setProperty(NativeWindow::Visible, true);
//win->requestProperty( NativeWindow::Active, true);
//win->requestProperties(QList<NativeWindow::Property>() << NativeWindow::Visible << NativeWindow::Active, QList<QVariant>() << true << true, true);
bgstack15