aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp58
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h9
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp4
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/events.pri2
4 files changed, 71 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp
index 24ad3fda..3bde9ab8 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp
@@ -10,6 +10,25 @@
NativeWindow::NativeWindow( NativeWindowObject *obj ) : QFrame(0, Qt::Window | Qt::FramelessWindowHint){
WIN = obj;
createFrame();
+ WIN->addFrameWinID(this->winId());
+ //Setup all the property connections
+ connect(WIN, SIGNAL(winImageChanged()), this, SLOT(syncWinImage()):
+ connect(WIN, SIGNAL(nameChanged()), this, SLOT(syncName()):
+ connect(WIN, SIGNAL(titleChanged()), this, SLOT(syncTitle()):
+ connect(WIN, SIGNAL(iconChanged()), this, SLOT(syncIcon()):
+ connect(WIN, SIGNAL(stickyChanged()), this, SLOT(syncSticky()):
+ connect(WIN, SIGNAL(visibilityChanged()), this, SLOT(syncVisibility()):
+ connect(WIN, SIGNAL(winTypeChanged()), this, SLOT(syncWinType()):
+ connect(WIN, SIGNAL(geomChanged()), this, SLOT(syncGeom()):
+ //Now Perform the initial property loads
+ syncWinImage();
+ syncName();
+ syncTitle();
+ syncIcon();
+ syncSticky();
+ syncVisibility();
+ syncWinType();
+ syncGeom();
}
NativeWindow::~NativeWindow(){
@@ -46,3 +65,42 @@ void NativeWindow::createFrame(){
}
// === PRIVATE SLOTS ===
+
+//Property Change slots
+void NativeWindow::syncWinImage(){
+ //Do nothing at the moment (compositing disabled)
+}
+
+void NativeWindow::syncName(){
+ qDebug() << "Got Name Change:" << WIN->name();
+}
+
+void NativeWindow::syncTitle(){
+ titleLabel->setText(WIN->title());
+}
+
+void NativeWindow::syncIcon(){
+ //Do not use the "WIN->icon()" function, that is the URL format for QML
+ otherB->setIcon( QIcon(WIN->property(NativeWindowObject::Icon).value<QIcon>()) );
+}
+
+void NativeWindow::syncSticky(){
+ qDebug() << "Got Sticky Change:" << WIN->isSticky();
+}
+
+void NativeWindow::syncVisibility(){
+ this->setVisible(WIN->isVisible());
+}
+
+void NativeWindow::syncWinType(){
+ closeB->setVisible(WIN->showCloseButton());
+ maxB->setVisible(WIN->showMaxButton());
+ minB->setVisible(WIN->showMinButton());
+ titleLabel->setVisible(WIN->showTitlebar());
+ otherB->setVisible(WIN->showGenericButton());
+
+}
+
+void NativeWindow::syncGeom(){
+
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
index ffdb364a..794cfad2 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
@@ -29,6 +29,15 @@ private:
private slots:
+ //Property Change slots
+ void syncWinImage();
+ void syncName();
+ void syncTitle();
+ void syncIcon();
+ void syncSticky();
+ void syncVisibility();
+ void syncWinType();
+ void syncGeom();
};
#endif
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp
index b9c1b6ef..da004061 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp
@@ -22,6 +22,7 @@
#include <xcb/xcb_aux.h>
#include <xcb/composite.h>
#include <xcb/damage.h>
+#include <xcb/screensaver.h>
//XLib includes (XCB Damage lib does not appear to register for damage events properly)
#include <X11/extensions/Xdamage.h>
@@ -84,7 +85,8 @@ inline void registerClientEvents(WId id, bool client = true){
| XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY
| XCB_EVENT_MASK_ENTER_WINDOW)
};*/
- xcb_change_window_attributes(QX11Info::connection(), id, XCB_CW_EVENT_MASK, values);
+ //xcb_change_window_attributes(QX11Info::connection(), id, XCB_CW_EVENT_MASK, values);
+ xcb_screensaver_select_input(QX11Info::connection(), id, values[0]);
}
/*inline void registerClientEvents(WId id){
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/events.pri b/src-qt5/core/lumina-desktop-unified/src-events/events.pri
index 3f586e8b..0bc89f64 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/events.pri
+++ b/src-qt5/core/lumina-desktop-unified/src-events/events.pri
@@ -1,6 +1,6 @@
# Files
QT *= x11extras
-LIBS *= -lc -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage -lxcb-util -lxcb-keysyms -lXdamage
+LIBS *= -lc -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage -lxcb-util -lxcb-keysyms -lxcb-screensaver -lXdamage
SOURCES *= $${PWD}/LShortcutEvents.cpp \
$${PWD}/NativeEventFilter.cpp \
bgstack15