diff options
author | Ken Moore <ken@ixsystems.com> | 2017-02-01 11:52:09 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-02-01 11:52:09 -0500 |
commit | 11918f54e194807c8ed6988c70306d883c8e9054 (patch) | |
tree | 1b6e3a1974aac02515b06e6b0a2c03161fddd125 /src-qt5/core/libLumina/NativeWindow.cpp | |
parent | Silence a file watcher warning when opening a blank or new file. (diff) | |
download | lumina-11918f54e194807c8ed6988c70306d883c8e9054.tar.gz lumina-11918f54e194807c8ed6988c70306d883c8e9054.tar.bz2 lumina-11918f54e194807c8ed6988c70306d883c8e9054.zip |
Add a new "NativeWindow" class to the library. This is a pure Qt container class for setting/announcing changes to native windows on the system. This allows the WM class (XCB/Wayland-specific) to simply adjust each window object as needed, and the interface (pure Qt) will automatically adjust as needed.
NOTE: Still need to adjust the LXCBEventFilter to use this new class, but the root window and rootsubwindow classes are all setup to use it.
Diffstat (limited to 'src-qt5/core/libLumina/NativeWindow.cpp')
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp new file mode 100644 index 00000000..eb85e394 --- /dev/null +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -0,0 +1,37 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2017, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "NativeWindow.h" + +// === PUBLIC === +NativeWindow::NativeWindow(WId id) : QObject(){ + winid = id; + WIN = QWindow::fromWinId(winid); +} + +NativeWindow::~NativeWindow(){ + hash.clear(); + WIN->deleteLater(); +} + +WId NativeWindow::id(){ + return winid; +} + +QWindow* NativeWindow::window(){ + return WIN; +} + +QVariant NativeWindow::property(NativeWindow::Property prop){ + if(hash.contains(prop)){ return hash.value(prop); } + return QVariant(); //null variant +} + +void NativeWindow::setProperty(NativeWindow::Property prop, QVariant val){ + if(prop == NativeWindow::None){ return; } + hash.insert(prop, val); + emit PropertyChanged(prop, val); +} |