diff options
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/libLumina/NativeEventFilter.cpp | 35 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.cpp | 8 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.h | 4 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeWindowSystem.h | 5 | ||||
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/global-includes.h | 6 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp | 1 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h | 2 |
8 files changed, 30 insertions, 40 deletions
diff --git a/src-qt5/core/libLumina/NativeEventFilter.cpp b/src-qt5/core/libLumina/NativeEventFilter.cpp index 537d54aa..4914cea3 100644 --- a/src-qt5/core/libLumina/NativeEventFilter.cpp +++ b/src-qt5/core/libLumina/NativeEventFilter.cpp @@ -146,7 +146,7 @@ bool EventFilter::nativeEventFilter(const QByteArray &eventType, void *message, break; case XCB_MOTION_NOTIFY: //This is a mouse movement event - //qDebug() << "Motion Notify Event"; + qDebug() << "Motion Notify Event"; obj->emit MouseMovement(); break; case XCB_ENTER_NOTIFY: @@ -166,47 +166,26 @@ bool EventFilter::nativeEventFilter(const QByteArray &eventType, void *message, break; //============================== case XCB_MAP_NOTIFY: - //qDebug() << "Window Map Event:" << ((xcb_map_notify_event_t *)ev)->window; - /*if(Lumina::SS->isLocked()){ waitingToShow << ((xcb_map_notify_event_t *)ev)->window ; } - else{ - for(int i=0; i<windows.length(); i++){ - if(windows[i]->id() == ((xcb_map_notify_event_t *)ev)->window){ windows[i]->setProperty(NativeWindow::Visible, true); break; } - } - }*/ + qDebug() << "Window Map Event:" << ((xcb_map_notify_event_t *)ev)->window; obj->emit WindowPropertyChanged( ((xcb_map_notify_event_t *)ev)->window, NativeWindow::Visible ); break; //This is just a notification that a window was mapped - nothing needs to change here case XCB_MAP_REQUEST: - //qDebug() << "Window Map Request Event"; + qDebug() << "Window Map Request Event"; obj->emit WindowCreated( ((xcb_map_request_event_t *) ev)->window ); - //SetupNewWindow( ); break; //============================== case XCB_CREATE_NOTIFY: - //qDebug() << "Window Create Event"; + qDebug() << "Window Create Event"; break; //============================== case XCB_UNMAP_NOTIFY: - //qDebug() << "Window Unmap Event:" << ((xcb_unmap_notify_event_t *)ev)->window; - /*if(waitingToShow.contains(((xcb_unmap_notify_event_t *)ev)->window)){ waitingToShow.removeAll(((xcb_unmap_notify_event_t *)ev)->window); } - for(int i=0; i<windows.length(); i++){ - if(windows[i]->id() == ((xcb_unmap_notify_event_t *)ev)->window){ windows[i]->setProperty(NativeWindow::Visible, false); break; } - }*/ + qDebug() << "Window Unmap Event:" << ((xcb_unmap_notify_event_t *)ev)->window; obj->emit WindowPropertyChanged( ((xcb_map_notify_event_t *)ev)->window, NativeWindow::Visible ); break; //============================== case XCB_DESTROY_NOTIFY: - //qDebug() << "Window Closed Event:" << ((xcb_destroy_notify_event_t *)ev)->window; + qDebug() << "Window Closed Event:" << ((xcb_destroy_notify_event_t *)ev)->window; obj->emit WindowDestroyed( ((xcb_destroy_notify_event_t *) ev)->window ); - /*if( !rmTrayApp( ((xcb_destroy_notify_event_t *) ev)->window ) ){ - //qDebug() <<" - Non-tray window"; - for(int i=0; i<windows.length(); i++){ - if(windows[i]->id() == ((xcb_destroy_notify_event_t *)ev)->window){ - windows[i]->emit WindowClosed(windows[i]->id()); - QTimer::singleShot(500, windows.takeAt(i), SLOT(deleteLater()) ); //give a few moments first, then clean up the object - break; - } - } - }*/ break; //============================== case XCB_FOCUS_IN: @@ -218,7 +197,7 @@ bool EventFilter::nativeEventFilter(const QByteArray &eventType, void *message, break; //============================== case XCB_PROPERTY_NOTIFY: - //qDebug() << "Property Notify Event:"; + qDebug() << "Property Notify Event:"; ParsePropertyEvent((xcb_property_notify_event_t*)ev, obj); break; //============================== diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 97131b52..020e4596 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -17,6 +17,14 @@ NativeWindow::~NativeWindow(){ //WIN->deleteLater(); //This class only deals with Native windows which were created outside the app - they need to be cleaned up outside the app too } +void NativeWindow::addFrameWinID(WId fid){ + relatedTo << fid; +} + +bool NativeWindow::isRelatedTo(WId tmp){ + return (relatedTo.contains(tmp) || winid == tmp); +} + WId NativeWindow::id(){ return winid; } diff --git a/src-qt5/core/libLumina/NativeWindow.h b/src-qt5/core/libLumina/NativeWindow.h index 351462bd..a3efd234 100644 --- a/src-qt5/core/libLumina/NativeWindow.h +++ b/src-qt5/core/libLumina/NativeWindow.h @@ -58,6 +58,9 @@ public: NativeWindow(WId id); ~NativeWindow(); + void addFrameWinID(WId); + bool isRelatedTo(WId); + WId id(); QWindow* window(); @@ -76,6 +79,7 @@ private: QHash <NativeWindow::Property, QVariant> hash; QWindow *WIN; WId winid; + QList<WId> relatedTo; signals: //General Notifications diff --git a/src-qt5/core/libLumina/NativeWindowSystem.h b/src-qt5/core/libLumina/NativeWindowSystem.h index 631b8cb2..c82c70fd 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.h +++ b/src-qt5/core/libLumina/NativeWindowSystem.h @@ -14,6 +14,7 @@ #include "NativeWindow.h" #include <QDateTime> #include <QTimer> +#include <QDebug> class NativeWindowSystem : public QObject{ Q_OBJECT @@ -26,14 +27,14 @@ private: qDebug() << "Find Window:" << id; for(int i=0; i<NWindows.length(); i++){ qDebug() << " -- Check Window:" << NWindows[i]->id(); - if(id==NWindows[i]->id()){ return NWindows[i]; } + if(NWindows[i]->isRelatedTo(id)){ qDebug() << " -- Got Match!"; return NWindows[i]; } } return 0; } NativeWindow* findTrayWindow(WId id){ for(int i=0; i<TWindows.length(); i++){ - if(id==TWindows[i]->id()){ return TWindows[i]; } + if(TWindows[i]->isRelatedTo(id)){ return TWindows[i]; } } return 0; } diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp index 3c8e5b97..fdb9ac76 100644 --- a/src-qt5/core/libLumina/RootSubWindow.cpp +++ b/src-qt5/core/libLumina/RootSubWindow.cpp @@ -10,7 +10,7 @@ #include <QVBoxLayout> #include <QVBoxLayout> -#define WIN_BORDER 3 +#define WIN_BORDER 5 // === PUBLIC === RootSubWindow::RootSubWindow(QWidget *root, NativeWindow *win) : QFrame(root){ @@ -24,6 +24,7 @@ RootSubWindow::RootSubWindow(QWidget *root, NativeWindow *win) : QFrame(root){ LoadProperties( NativeWindow::allProperties() ); //Hookup the signals/slots connect(WIN, SIGNAL(PropertiesChanged(QList<NativeWindow::Property>, QList<QVariant>)), this, SLOT(propertiesChanged(QList<NativeWindow::Property>, QList<QVariant>))); + WIN->addFrameWinID(this->winId()); } RootSubWindow::~RootSubWindow(){ @@ -123,7 +124,7 @@ void RootSubWindow::setMouseCursor(ModState state, bool override){ } void RootSubWindow::initWindowFrame(){ - qDebug() << "Create RootSubWindow Frame"; + //qDebug() << "Create RootSubWindow Frame"; mainLayout = new QVBoxLayout(this); titleBar = new QHBoxLayout(this); closeB = new QToolButton(this); @@ -161,8 +162,8 @@ void RootSubWindow::initWindowFrame(){ mainLayout->setSpacing(0); titleBar->setSpacing(1); titleBar->setContentsMargins(0,0,0,0); - this->setLayout(mainLayout); - qDebug() << " - Done"; + //this->setLayout(mainLayout); + //qDebug() << " - Done"; } void RootSubWindow::LoadProperties( QList< NativeWindow::Property> list){ diff --git a/src-qt5/core/lumina-desktop-unified/global-includes.h b/src-qt5/core/lumina-desktop-unified/global-includes.h index 53caf88f..94b1a364 100644 --- a/src-qt5/core/lumina-desktop-unified/global-includes.h +++ b/src-qt5/core/lumina-desktop-unified/global-includes.h @@ -66,10 +66,6 @@ #include <unistd.h> //Setup any global defines (no classes or global objects: use "global-objects.h" for that) -namespace Lumina{ - //Flags/enumerations - enum WindowAction{MoveResize, Show, Hide, TryClose, Closed, WA_NONE}; - enum MouseButton{NoButton, LeftButton, RightButton, MidButton, BackButton, ForwardButton, TaskButton, WheelUp, WheelDown, WheelLeft, WheelRight}; -}; + #endif diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp index 6bd36ef6..0a78fb25 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp @@ -85,6 +85,7 @@ void DesktopContextMenu::start(){ // === PRIVATE SLOTS === void DesktopContextMenu::LaunchAction(QAction *act){ + //qDebug() << "Launch Action Triggered:" << act->whatsThis(); if(act->whatsThis().isEmpty() || act->parent()!=this ){ return; } qDebug() << "Launch Menu Action:" << act->whatsThis(); QString cmd = act->whatsThis(); diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h index 8b0509fb..1e3165ec 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h @@ -19,7 +19,7 @@ private: QLabel *workspaceLabel; QWidgetAction *wkspaceact; -public: +public: DesktopContextMenu(QWidget *parent = 0); ~DesktopContextMenu(); |