diff options
27 files changed, 231 insertions, 91 deletions
diff --git a/DEPENDENCIES b/DEPENDENCIES index 7d0395cd..40fe287c 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -82,9 +82,7 @@ X.org and XCB extensions (possibly the XLib libraries above during the transitio libxdamage-dev libxrender-dev libxcb-image0-dev - - These additional dependencies are needed to build the window manager: - libxcb-screensaver0-dev + qtdeclarative5-dev These packages are required for running Lumina on Linux fluxbox diff --git a/debian/changelog b/debian/changelog index bf62959c..02b4029a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +lumina-desktop (0.8.5.754-1nano) unstable; urgency=low + + * New git snapshot + - update LOS::MemoryUsagePercent() for output format + change in latest version of 'top' in Debian + + -- Christopher Roy Bratusek <nano@jpberlin.de> Sat, 11 Jul 2015 16:07:42 +0200 + lumina-desktop (0.8.5.697-1nano) unstable; urgency=low * New git snapshot diff --git a/debian/control b/debian/control index 3c71f0e9..9e7f026a 100644 --- a/debian/control +++ b/debian/control @@ -7,8 +7,8 @@ Build-Depends: debhelper (>= 9), qt5-qmake, qtbase5-dev, qtmultimedia5-dev, libx11-dev, libxrender-dev, libxcomposite-dev, libxdamage-dev, libxcb-icccm4-dev, libxcb-damage0-dev, libxcb-util0-dev, libqt5x11extras5-dev, qttools5-dev-tools, libxcb-image0-dev, - libxcb-composite0-dev -Standards-Version: 3.9.5 + libxcb-composite0-dev, qtdeclarative5-dev +Standards-Version: 3.9.6 Homepage: https://github.com/pcbsd/lumina Package: lumina-desktop @@ -113,7 +113,7 @@ Description: Desktop file editor for the lumina desktop environment Package: lumina-data Architecture: all -Depends: ${misc:Depends}, libluminautils1, lumina-desktop +Depends: ${misc:Depends}, libluminautils1 Replaces: lumina-core (<< 0.8.3.372) Description: Data files for the lumina Desktop environment This package provides diff --git a/debian/docs b/debian/docs index 0674dc87..b43bf86b 100644 --- a/debian/docs +++ b/debian/docs @@ -1,2 +1 @@ README.md -ROADMAP diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..a9b2b04c --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +https://github.com/pcbsd/lumina/releases/ .*/v(\d[\d\.]+)-Release\.tar\.gz diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index 12d8f11e..85dd657e 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -262,12 +262,12 @@ int LOS::CPUUsagePercent(){ //Returns: Overall percentage of the amount of CPU c } int LOS::MemoryUsagePercent(){ - QStringList mem = LUtils::getCmdOutput("top -bn1").filter("Mem:"); + QStringList mem = LUtils::getCmdOutput("top -bn1").filter("Mem :"); if(mem.isEmpty()){ return -1; } double fB = 0; //Free Bytes double uB = 0; //Used Bytes - fB = mem.first().section(" ", 6, 6, QString::SectionSkipEmpty).toDouble(); - uB = mem.first().section(" ", 4, 4, QString::SectionSkipEmpty).toDouble(); + fB = mem.first().section(" ", 5, 5, QString::SectionSkipEmpty).toDouble(); + uB = mem.first().section(" ", 7, 7, QString::SectionSkipEmpty).toDouble(); double per = (uB/(fB+uB)) * 100.0; return qRound(per); } diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index b5d3ed80..fd117079 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -339,7 +339,7 @@ QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for ea if(i==1){ labs = info[i].split(" ", QString::SkipEmptyParts); }//the labels for each column else{ QStringList data = info[i].split(" ",QString::SkipEmptyParts); //data[0] is always the device - qDebug() << "Data Line:" << data; + //qDebug() << "Data Line:" << data; if(data.length()>2 && labs.length()>2){ out << fmt.arg(data[0], data[1]+" "+labs[1], data[2]+" "+labs[2]); } diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 42f36962..9d1eaf0d 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -24,7 +24,7 @@ static QStringList fav; // LUtils Functions //============= QString LUtils::LuminaDesktopVersion(){ - return "0.8.5-devel"; + return "0.8.6-devel"; } int LUtils::runCmd(QString cmd, QStringList args){ @@ -202,19 +202,24 @@ QStringList LUtils::listQuickPlugins(){ QDir dir(QDir::homePath()+"/.lumina/quickplugins"); QStringList files = dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name); dir.cd(LOS::LuminaShare()+"quickplugins"); - files << files = dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name); + files << dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name); for(int i=0; i<files.length(); i++){ files[i] = files[i].section("quick-",1,100).section(".qml",0,0); //just grab the ID out of the middle of the filename } files.removeDuplicates(); + //qDebug() << "Found Quick Plugins:" << files; return files; } QStringList LUtils::infoQuickPlugin(QString ID){ //Returns: [Name, Description, Icon] + //qDebug() << "Find Quick Info:" << ID; QString path = findQuickPluginFile(ID); + //qDebug() << " - path:" << path; if(path.isEmpty()){ return QStringList(); } //invalid ID - QStringList contents = LUtils::readFile(path).filter("//").filter("=").filter("Plugin"); + QStringList contents = LUtils::readFile(path); if(contents.isEmpty()){ return QStringList(); } //invalid file (unreadable) + contents = contents.filter("//").filter("=").filter("Plugin"); //now just grab the comments + //qDebug() << " - Filtered Contents:" << contents; QStringList info; info << "" << "" << ""; for(int i=0; i<contents.length(); i++){ if(contents[i].contains("Plugin-Name=")){ info[0] = contents[i].section("Plugin-Name=",1,1).simplified(); } @@ -223,6 +228,7 @@ QStringList LUtils::infoQuickPlugin(QString ID){ //Returns: [Name, Description, } if(info[0].isEmpty()){ info[0]=ID; } if(info[2].isEmpty()){ info[2]="preferences-plugin"; } + //qDebug() << " - info:" << info; return info; } diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp index 770f64db..ba091771 100644 --- a/libLumina/LuminaX11.cpp +++ b/libLumina/LuminaX11.cpp @@ -29,6 +29,7 @@ #include <xcb/composite.h> #include <xcb/damage.h> +#define DEBUG 0 //===== WindowList() ======== QList<WId> LX11::WindowList(){ @@ -849,6 +850,7 @@ LXCB::~LXCB(){ // === WindowList() === QList<WId> LXCB::WindowList(bool rawlist){ + if(DEBUG){ qDebug() << "XCB: WindowList()" << rawlist; } QList<WId> output; //qDebug() << "Get Client list cookie"; xcb_get_property_cookie_t cookie = xcb_ewmh_get_client_list_unchecked( &EWMH, 0); @@ -872,6 +874,7 @@ QList<WId> LXCB::WindowList(bool rawlist){ // === CurrentWorkspace() === unsigned int LXCB::CurrentWorkspace(){ + if(DEBUG){ qDebug() << "XCB: CurrentWorkspace()"; } //qDebug() << "Get Current Workspace"; xcb_get_property_cookie_t cookie = xcb_ewmh_get_current_desktop_unchecked(&EWMH, 0); uint32_t wkspace = 0; @@ -882,6 +885,7 @@ unsigned int LXCB::CurrentWorkspace(){ // === ActiveWindow() === WId LXCB::ActiveWindow(){ + if(DEBUG){ qDebug() << "XCB: ActiveWindow()"; } xcb_get_property_cookie_t cookie = xcb_ewmh_get_active_window_unchecked(&EWMH, 0); xcb_window_t actwin; if(1 == xcb_ewmh_get_active_window_reply(&EWMH, cookie, &actwin, NULL) ){ @@ -893,6 +897,7 @@ WId LXCB::ActiveWindow(){ // === RegisterVirtualRoots() === void LXCB::RegisterVirtualRoots(QList<WId> roots){ + if(DEBUG){ qDebug() << "XCB: RegisterVirtualRoots()"; } //First convert the QList into the proper format xcb_window_t *list = new xcb_window_t[ roots.length() ]; for(int i=0; i<roots.length(); i++){ @@ -906,6 +911,7 @@ void LXCB::RegisterVirtualRoots(QList<WId> roots){ // === WindowClass() === QString LXCB::WindowClass(WId win){ + if(DEBUG){ qDebug() << "XCB: WindowClass()" << win; } QString out; if(win==0){ return ""; } xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_class_unchecked(QX11Info::connection(), win); @@ -920,6 +926,7 @@ QString LXCB::WindowClass(WId win){ // === WindowWorkspace() === unsigned int LXCB::WindowWorkspace(WId win){ + if(DEBUG){ qDebug() << "XCB: WindowWorkspace()" << win; } //qDebug() << "Get Window Workspace"; if(win==0){ return 0; } uint32_t wkspace = 0; @@ -932,6 +939,7 @@ unsigned int LXCB::WindowWorkspace(WId win){ // === WindowGeometry() === QRect LXCB::WindowGeometry(WId win, bool includeFrame){ + if(DEBUG){ qDebug() << "XCB: WindowGeometry()"; } QRect geom; if(win==0){ return geom; } xcb_get_geometry_cookie_t cookie = xcb_get_geometry(QX11Info::connection(), win); @@ -974,14 +982,17 @@ QRect LXCB::WindowGeometry(WId win, bool includeFrame){ } QList<int> LXCB::WindowFrameGeometry(WId win){ + if(DEBUG){ qDebug() << "XCB: WindowFrameGeometry()"; } //Returns: [top, bottom, left, right] sizes for the frame QList<int> geom; - xcb_get_property_cookie_t cookie = xcb_ewmh_get_frame_extents_unchecked(&EWMH, win); - if(cookie.sequence != 0){ - xcb_ewmh_get_extents_reply_t frame; - if(1== xcb_ewmh_get_frame_extents_reply(&EWMH, cookie, &frame, NULL) ){ - //adjust the origin point to account for the frame - geom << frame.top << frame.bottom << frame.left << frame.right; + if(win!=0){ + xcb_get_property_cookie_t cookie = xcb_ewmh_get_frame_extents_unchecked(&EWMH, win); + if(cookie.sequence != 0){ + xcb_ewmh_get_extents_reply_t frame; + if(1== xcb_ewmh_get_frame_extents_reply(&EWMH, cookie, &frame, NULL) ){ + //adjust the origin point to account for the frame + geom << frame.top << frame.bottom << frame.left << frame.right; + } } } if(geom.isEmpty()){ geom << 0 << 0 << 0 << 0; } @@ -990,6 +1001,7 @@ QList<int> LXCB::WindowFrameGeometry(WId win){ // === WindowState() === LXCB::WINDOWSTATE LXCB::WindowState(WId win){ + if(DEBUG){ qDebug() << "XCB: WindowState()"; } if(win==0){ return IGNORE; } xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_state_unchecked(&EWMH, win); if(cookie.sequence == 0){ return IGNORE; } @@ -1033,6 +1045,7 @@ LXCB::WINDOWSTATE LXCB::WindowState(WId win){ // === WindowVisibleIconName() === QString LXCB::WindowVisibleIconName(WId win){ //_NET_WM_VISIBLE_ICON_NAME + if(DEBUG){ qDebug() << "XCB: WindowVisibleIconName()"; } if(win==0){ return ""; } QString out; xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_visible_icon_name_unchecked(&EWMH, win); @@ -1046,6 +1059,7 @@ QString LXCB::WindowVisibleIconName(WId win){ //_NET_WM_VISIBLE_ICON_NAME // === WindowIconName() === QString LXCB::WindowIconName(WId win){ //_NET_WM_ICON_NAME + if(DEBUG){ qDebug() << "XCB: WindowIconName()"; } if(win==0){ return ""; } QString out; xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_icon_name_unchecked(&EWMH, win); @@ -1059,6 +1073,7 @@ QString LXCB::WindowIconName(WId win){ //_NET_WM_ICON_NAME // === WindowVisibleName() === QString LXCB::WindowVisibleName(WId win){ //_NET_WM_VISIBLE_NAME + if(DEBUG){ qDebug() << "XCB: WindowVisibleName()"; } if(win==0){ return ""; } QString out; xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_visible_name_unchecked(&EWMH, win); @@ -1072,6 +1087,7 @@ QString LXCB::WindowVisibleName(WId win){ //_NET_WM_VISIBLE_NAME // === WindowName() === QString LXCB::WindowName(WId win){ //_NET_WM_NAME + if(DEBUG){ qDebug() << "XCB: WindowName()"; } if(win==0){ return ""; } QString out; xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name_unchecked(&EWMH, win); @@ -1085,6 +1101,7 @@ QString LXCB::WindowName(WId win){ //_NET_WM_NAME // === OldWindowName() === QString LXCB::OldWindowName(WId win){ //WM_NAME (old standard) + if(DEBUG){ qDebug() << "XCB: OldWindowName()"; } if(win==0){ return ""; } xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_name_unchecked(QX11Info::connection(), win); xcb_icccm_get_text_property_reply_t reply; @@ -1099,6 +1116,7 @@ QString LXCB::OldWindowName(WId win){ //WM_NAME (old standard) // === OldWindowIconName() === QString LXCB::OldWindowIconName(WId win){ //WM_ICON_NAME (old standard) + if(DEBUG){ qDebug() << "XCB: OldWindowIconName()"; } if(win==0){ return ""; } xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_icon_name_unchecked(QX11Info::connection(), win); xcb_icccm_get_text_property_reply_t reply; @@ -1113,6 +1131,7 @@ QString LXCB::OldWindowIconName(WId win){ //WM_ICON_NAME (old standard) // === WindowIsMaximized() === bool LXCB::WindowIsMaximized(WId win){ + if(DEBUG){ qDebug() << "XCB: WindowIsMaximized()"; } if(win==0){ return ""; } //See if the _NET_WM_STATE_MAXIMIZED_[VERT/HORZ] flags are set on the window xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_state_unchecked(&EWMH, win); @@ -1133,6 +1152,7 @@ bool LXCB::WindowIsMaximized(WId win){ // === WindowIcon() === QIcon LXCB::WindowIcon(WId win){ //Fetch the _NET_WM_ICON for the window and return it as a QIcon + if(DEBUG){ qDebug() << "XCB: WindowIcon()"; } QIcon icon; if(win==0){ return icon; } xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_icon_unchecked(&EWMH, win); @@ -1163,6 +1183,7 @@ QIcon LXCB::WindowIcon(WId win){ // === SetAsSticky() === void LXCB::SetAsSticky(WId win){ + if(DEBUG){ qDebug() << "XCB: SetAsSticky()"; } if(win==0){ return; } //Need to send a client message event for the window so the WM picks it up xcb_client_message_event_t event; @@ -1183,9 +1204,20 @@ void LXCB::SetAsSticky(WId win){ xcb_flush(QX11Info::connection()); //apply it right away*/ } +// === SetDisableWMActions() === +void LXCB::SetDisableWMActions(WId win){ + if(DEBUG){ qDebug() << "XCB: SetDisableWMActions()"; } + //This disables all the various control that a WM allows for the window (except for allowing the "Sticky" state) + xcb_atom_t list[1]; + list[0] = EWMH._NET_WM_ACTION_STICK; + xcb_ewmh_set_wm_allowed_actions(&EWMH, win, 1, list); +} + // === SetAsPanel() === void LXCB::SetAsPanel(WId win){ + if(DEBUG){ qDebug() << "XCB: SetAsPanel()"; } if(win==0){ return; } + SetDisableWMActions(win); //also need to disable WM actions for this window //Disable Input focus (panel activation ruins task manager window detection routines) // - Disable Input flag in WM_HINTS xcb_icccm_wm_hints_t hints; @@ -1262,20 +1294,32 @@ void LXCB::SetAsPanel(WId win){ } +void LXCB::SetAsDesktop(WId win){ + if(DEBUG){ qDebug() << "XCB: SetAsDesktop()"; } + if(win==0){ return; } + SetDisableWMActions(win); //also need to disable WM actions for this window + xcb_atom_t list[1]; + list[0] = EWMH._NET_WM_WINDOW_TYPE_DESKTOP; + xcb_ewmh_set_wm_window_type(&EWMH, win, 1, list); +} + // === CloseWindow() === void LXCB::CloseWindow(WId win){ + if(DEBUG){ qDebug() << "XCB: CloseWindow()"; } if(win==0){ return; } //This will close the specified window (might not close the entire application) xcb_ewmh_request_close_window(&EWMH, 0, win, QX11Info::getTimestamp(), XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER); } void LXCB::KillClient(WId win){ + if(DEBUG){ qDebug() << "XCB: KillClient()"; } if(win==0){ return; } //This will forcibly close the application which created WIN xcb_kill_client(QX11Info::connection(), win); } // === MinimizeWindow() === void LXCB::MinimizeWindow(WId win){ //request that the window be unmapped/minimized + if(DEBUG){ qDebug() << "XCB: MinimizeWindow()"; } if(win==0){ return; } //Note: Fluxbox completely removes this window from the open list if unmapped manually // xcb_unmap_window(QX11Info::connection(), win); @@ -1298,6 +1342,7 @@ void LXCB::MinimizeWindow(WId win){ //request that the window be unmapped/minimi // === ActivateWindow() === void LXCB::ActivateWindow(WId win){ //request that the window become active + if(DEBUG){ qDebug() << "XCB: ActivateWindow();"; } if(win==0){ return; } //First need to get the currently active window xcb_get_property_cookie_t cookie = xcb_ewmh_get_active_window_unchecked(&EWMH, 0); @@ -1325,6 +1370,7 @@ void LXCB::ActivateWindow(WId win){ //request that the window become active // === MaximizeWindow() === void LXCB::MaximizeWindow(WId win, bool flagsonly){ //request that the window become maximized + if(DEBUG){ qDebug() << "XCB: MaximizeWindow()"; } if(win==0){ return; } if(flagsonly){ //Directly set the flags on the window (bypassing the WM) @@ -1352,6 +1398,7 @@ void LXCB::MaximizeWindow(WId win, bool flagsonly){ //request that the window be // === MoveResizeWindow() === void LXCB::MoveResizeWindow(WId win, QRect geom){ + if(DEBUG){ qDebug() << "XCB: MoveResizeWindow()"; } if(win==0){ return; } //NOTE: geom needs to be in root/absolute coordinates! //qDebug() << "MoveResize Window:" << geom.x() << geom.y() << geom.width() << geom.height(); @@ -1371,6 +1418,7 @@ void LXCB::MoveResizeWindow(WId win, QRect geom){ // === EmbedWindow() === uint LXCB::EmbedWindow(WId win, WId container){ + if(DEBUG){ qDebug() << "XCB: EmbedWindow()"; } //This returns the damage control ID number (or 0 for a failure) if(win==0 || container==0){ return 0; } //qDebug() << "Embed Window:" << win << container; @@ -1423,6 +1471,7 @@ uint LXCB::EmbedWindow(WId win, WId container){ // === Unembed Window() === bool LXCB::UnembedWindow(WId win){ + if(DEBUG){ qDebug() << "XCB: UnembedWindow()"; } if(win==0){ return false; } //Display *disp = QX11Info::display(); //Remove redirects diff --git a/libLumina/LuminaX11.h b/libLumina/LuminaX11.h index 468045d1..d098a740 100644 --- a/libLumina/LuminaX11.h +++ b/libLumina/LuminaX11.h @@ -145,7 +145,9 @@ public: //Window Modification void SetAsSticky(WId); //Stick to all workspaces + void SetDisableWMActions(WId); //Disable WM control (shortcuts/automatic functions) void SetAsPanel(WId); //Adjust all the window flags for a proper panel (cannot be done through Qt) + void SetAsDesktop(WId); //Adjust window flags to set as the desktop void CloseWindow(WId); //request that the window be closed void KillClient(WId); //Force the application that created the window to close void MinimizeWindow(WId); //request that the window be unmapped/minimized diff --git a/lumina-config/lumina-config.pro b/lumina-config/lumina-config.pro index 284cd0a4..f7df7cdf 100644 --- a/lumina-config/lumina-config.pro +++ b/lumina-config/lumina-config.pro @@ -123,3 +123,7 @@ dotrans.path=$$PREFIX/share/Lumina-DE/i18n/ dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/ INSTALLS += target dotrans + +NO_I18N{ + INSTALLS -= dotrans +}
\ No newline at end of file diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index ec56b7b0..7b21b862 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -292,8 +292,8 @@ void LDesktop::InitDesktop(){ bgWindow = new QWidget(); bgWindow->setObjectName("bgWindow"); bgWindow->setContextMenuPolicy(Qt::CustomContextMenu); - bgWindow->setWindowFlags(Qt::FramelessWindowHint); - LX11::SetAsDesktop(bgWindow->winId()); + bgWindow->setWindowFlags(Qt::WindowStaysOnBottomHint | Qt::CustomizeWindowHint | Qt::FramelessWindowHint); + LSession::handle()->XCB->SetAsDesktop(bgWindow->winId()); bgWindow->setGeometry(desktop->screenGeometry(desktopnumber)); connect(bgWindow, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowMenu()) ); if(DEBUG){ qDebug() << "Create bgDesktop"; } @@ -361,8 +361,6 @@ void LDesktop::UpdateMenu(bool fast){ if(!desktoplocked){ deskMenu->addAction(LXDG::findIcon("document-encrypt",""),tr("Lock Desktop"), this, SLOT(ToggleDesktopLock()) ); deskMenu->addAction(LXDG::findIcon("snap-orthogonal",""),tr("Snap Plugins to Grid"), this, SLOT(AlignDesktopPlugins()) ); - deskMenu->addAction(LXDG::findIcon("shapes",""), tr("Tile Plugins"), bgDesktop, SLOT(tileSubWindows()) ); - deskMenu->addAction(LXDG::findIcon("window-duplicate",""), tr("Cascade Plugins"), bgDesktop, SLOT(cascadeSubWindows()) ); }else{ deskMenu->addAction(LXDG::findIcon("document-decrypt",""),tr("Unlock Desktop"), this, SLOT(ToggleDesktopLock()) ); } deskMenu->addSeparator(); deskMenu->addAction(LXDG::findIcon("system-log-out",""), tr("Log Out"), this, SLOT(SystemLogout()) ); @@ -649,6 +647,8 @@ void LDesktop::UpdateDesktopPluginArea(){ for(int i=0; i<PANELS.length(); i++){ PANELS[i]->update(); } //Also need to re-arrange any desktop plugins to ensure that nothing is out of the screen area AlignDesktopPlugins(); + //Make sure to re-disable any WM control flags + LSession::handle()->XCB->SetDisableWMActions(bgWindow->winId()); } void LDesktop::UpdateBackground(){ diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp index 11a5a988..94db8ce0 100644 --- a/lumina-desktop/LPanel.cpp +++ b/lumina-desktop/LPanel.cpp @@ -38,7 +38,8 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){ this->setAttribute(Qt::WA_X11DoNotAcceptFocus); this->setAttribute(Qt::WA_X11NetWmWindowTypeDock); this->setAttribute(Qt::WA_AlwaysShowToolTips); - this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); + this->setWindowFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint); + //this->setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint); this->setWindowTitle("LuminaPanel"); this->setObjectName("LuminaPanelBackgroundWidget"); @@ -51,11 +52,9 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){ panelArea->setLayout(layout); //Set special window flags on the panel for proper usage this->show(); - //this->setFocusPolicy(Qt::NoFocus); + LSession::handle()->XCB->SetAsPanel(this->winId()); LSession::handle()->XCB->SetAsSticky(this->winId()); - //LSession::handle()->XCB->SetAsPanel(this->winId()); - LX11::SetAsPanel(this->winId()); - + QTimer::singleShot(1,this, SLOT(UpdatePanel()) ); //start this in a new thread connect(screen, SIGNAL(resized(int)), this, SLOT(UpdatePanel()) ); //in case the screen resolution changes } @@ -188,12 +187,8 @@ void LPanel::UpdatePanel(){ } } //With QT5, we need to make sure to reset window properties on occasion + //LSession::handle()->XCB->SetDisableWMActions(this->winId()); //ensure no WM actions //LSession::handle()->XCB->SetAsSticky(this->winId()); - //LX11::SetAsPanel(this->winId()); - //First test/update all the window attributes as necessary - //if(!this->testAttribute(Qt::WA_X11DoNotAcceptFocus)){ this->setAttribute(Qt::WA_X11DoNotAcceptFocus); } - //if(!this->testAttribute(Qt::WA_X11NetWmWindowTypeDock)){ this->setAttribute(Qt::WA_X11NetWmWindowTypeDock); } - //if(!this->testAttribute(Qt::WA_AlwaysShowToolTips)){ this->setAttribute(Qt::WA_AlwaysShowToolTips); } //Now update the appearance of the toolbar if(settings->value(PPREFIX+"customcolor", false).toBool()){ diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index aa1c1e0c..a0424667 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -320,6 +320,15 @@ void LSession::watcherChange(QString changed){ } } +void LSession::checkWindowGeoms(){ + //Only do one window per run (this will be called once per new window - with time delays between) + if(checkWin.isEmpty()){ return; } + if(RunningApps.contains(checkWin[0]) ){ //just to make sure it did not close during the delay + adjustWindowGeom( checkWin[0] ); + } + checkWin.removeAt(0); +} + void LSession::checkUserFiles(){ //internal version conversion examples: // [1.0.0 -> 1000000], [1.2.3 -> 1002003], [0.6.1 -> 6001] @@ -450,11 +459,18 @@ void LSession::registerDesktopWindows(){ } void LSession::adjustWindowGeom(WId win, bool maximize){ + if(DEBUG){ qDebug() << "AdjustWindowGeometry():" << win << maximize; } //Quick hack for making sure that new windows are not located underneath any panels // Get the window location - QRect geom = XCB->WindowGeometry(win, true); //always include the frame if possible - if(DEBUG){ qDebug() << "Check Window Geometry:" << XCB->WindowClass(win) << !geom.isNull(); } - if(geom.isNull()){ return; } //Could not get geometry + QRect geom = XCB->WindowGeometry(win, false); + //Get the frame size + QList<int> frame = XCB->WindowFrameGeometry(win); //[top,bottom,left,right] sizes of the frame + //Calculate the full geometry (window + frame) + QRect fgeom = QRect(geom.x()-frame[2], geom.y()-frame[0], geom.width()+frame[2]+frame[3], geom.height()+frame[0]+frame[1]); + if(DEBUG){ + qDebug() << "Check Window Geometry:" << XCB->WindowClass(win) << !geom.isNull() << geom << fgeom; + } + if(geom.isNull()){ return; } //Could not get geometry for some reason //Get the available geometry for the screen the window is on QRect desk; for(int i=0; i<DESKTOPS.length(); i++){ @@ -462,9 +478,11 @@ void LSession::adjustWindowGeom(WId win, bool maximize){ //Window is on this screen if(DEBUG){ qDebug() << " - On Screen:" << DESKTOPS[i]->Screen(); } desk = DESKTOPS[i]->availableScreenGeom(); + if(DEBUG){ qDebug() << " - Screen Geom:" << desk; } break; } } + if(desk.isNull()){ return; } //Unable to deteremine screen //Adjust the window location if necessary if(maximize){ if(DEBUG){ qDebug() << " - Maximizing New Window:" << desk.width() << desk.height(); } @@ -472,28 +490,36 @@ void LSession::adjustWindowGeom(WId win, bool maximize){ XCB->MoveResizeWindow(win, geom); XCB->MaximizeWindow(win, true); //directly set the appropriate "maximized" flags (bypassing WM) - }else if(!desk.contains(geom) ){ - if(DEBUG){ - qDebug() << " - Desk:" << desk.x() << desk.y() << desk.width() << desk.height(); - qDebug() << " - Geom:" << geom.x() << geom.y() << geom.width() << geom.height(); - } - QList<int> frame = XCB->WindowFrameGeometry(win); - if(DEBUG){ qDebug() << " - Frame:" << frame; } + }else if(!desk.contains(fgeom) ){ //Adjust origin point for left/top margins - if(geom.y() < desk.y()){ geom.moveTop(desk.y()); } //move down to the edge (top panel) - if(geom.x() < desk.x()){ geom.moveLeft(desk.x()); } //move right to the edge (left panel) + if(fgeom.y() < desk.y()){ geom.moveTop(desk.y()+frame[0]); fgeom.moveTop(desk.y()); } //move down to the edge (top panel) + if(fgeom.x() < desk.x()){ geom.moveLeft(desk.x()+frame[2]); fgeom.moveLeft(desk.x()); } //move right to the edge (left panel) //Adjust size for bottom margins (within reason, since window titles are on top normally) // if(geom.right() > desk.right() && (geom.width() > 100)){ geom.setRight(desk.right()); } - if(geom.bottom() > desk.bottom() && geom.height() > 10){ - //Also adjust the sizing for the frame (the moveResize fuction is for the base window only) - geom.setBottom(desk.bottom()-frame[0]-frame[1]); + if(fgeom.bottom() > desk.bottom() && geom.height() > 10){ + if(DEBUG){ qDebug() << "Adjust Y:" << fgeom << geom << desk; } + int diff = fgeom.bottom()-desk.bottom(); //amount of overlap + if(DEBUG){ qDebug() << "Y-Diff:" << diff; } + if(diff < 0){ diff = -diff; } //need a positive value + if( (fgeom.height()+ diff)< desk.height()){ + //just move the window - there is room for it above + geom.setBottom(desk.bottom()-frame[1]); + fgeom.setBottom(desk.bottom()); + }else if(geom.height() < diff){ //window bigger than the difference + //Need to resize the window - keeping the origin point the same + geom.setHeight( geom.height()-diff-1 ); //shrink it by the difference (need an extra pixel somewhere) + fgeom.setHeight( fgeom.height()-diff ); + } } //Now move/resize the window - if(DEBUG){ qDebug() << " - New Geom:" << geom.x() << geom.y() << geom.width() << geom.height(); } - XCB->MoveResizeWindow(win, geom); + if(DEBUG){ + qDebug() << " - New Geom:" << geom << fgeom; + } + //Note: Fluxbox treats this weird, the origin point needs to be the total (frame included), + // but the size needs to be the raw (no frame) value + XCB->MoveResizeWindow(win, QRect(fgeom.topLeft(), geom.size()) ); } - } void LSession::SessionEnding(){ @@ -541,13 +567,7 @@ void LSession::systemWindow(){ void LSession::playAudioFile(QString filepath){ //Setup the audio output systems for the desktop if(DEBUG){ qDebug() << "Play Audio File"; } - //if(audioThread==0){ qDebug() << " - Initialize audio systems"; audioThread = new QThread(); init = true; } if(mediaObj==0){ qDebug() << " - Initialize media player"; mediaObj = new QMediaPlayer(); } - /*if(mediaObj && init){ //in case it errors for some reason - qDebug() << " -- Move audio objects to separate thread"; - mediaObj->moveToThread(audioThread); - audioThread->start(); - }*/ if(mediaObj !=0 ){ if(DEBUG){ qDebug() << " - starting playback:" << filepath; } mediaObj->setVolume(100); @@ -569,7 +589,10 @@ void LSession::WindowPropertyEvent(){ LSession::restoreOverrideCursor(); //restore the mouse cursor back to normal (new window opened?) //Perform sanity checks on any new window geometries for(int i=0; i<newapps.length() && !TrayStopping; i++){ - if(!RunningApps.contains(newapps[i])){ adjustWindowGeom(newapps[i]); } + if(!RunningApps.contains(newapps[i])){ + checkWin << newapps[i]; + QTimer::singleShot(500, this, SLOT(checkWindowGeoms()) ); + } } } RunningApps = newapps; diff --git a/lumina-desktop/LSession.h b/lumina-desktop/LSession.h index 867f4bd9..b7e6de63 100644 --- a/lumina-desktop/LSession.h +++ b/lumina-desktop/LSession.h @@ -111,6 +111,7 @@ private: //Task Manager Variables QList<WId> RunningApps; + QList<WId> checkWin; QFileInfoList desktopFiles; void CleanupSession(); @@ -125,6 +126,7 @@ public slots: private slots: void watcherChange(QString); + void checkWindowGeoms(); //System Tray Functions void startSystemTray(); diff --git a/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h index 3a14b26c..0e6cda2f 100644 --- a/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h +++ b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h @@ -23,8 +23,10 @@ public: this->layout()->setContentsMargins(0,0,0,0); container = new QQuickWidget(this); container->setResizeMode(QQuickWidget::SizeRootObjectToView); + connect(container, SIGNAL(statusChanged(QQuickWidget::Status)), this, SLOT(statusChange(QQuickWidget::Status)) ); this->layout()->addWidget(container); container->setSource(QUrl::fromLocalFile( LUtils::findQuickPluginFile(ID.section("---",0,0)) )); + QApplication::processEvents(); //to check for errors right away this->setInitialSize(container->initialSize().width(), container->initialSize().height()); } @@ -37,6 +39,7 @@ private slots: void statusChange(QQuickWidget::Status status){ if(status == QQuickWidget::Error){ qDebug() << "Quick Widget Error:" << this->ID(); + container->setSource(QUrl()); //clear out the script - experienced an error } } diff --git a/lumina-desktop/fluxboxconf/fluxbox-keys b/lumina-desktop/fluxboxconf/fluxbox-keys index f0ec3519..97c53b2e 100644 --- a/lumina-desktop/fluxboxconf/fluxbox-keys +++ b/lumina-desktop/fluxboxconf/fluxbox-keys @@ -15,24 +15,20 @@ OnTitlebar Mouse2 :StartTabbing OnTitlebar Double Mouse1 :Shade OnTitlebar Mouse3 :WindowMenu -!mouse actions added by fluxbox-update_configs -OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving} -OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing BottomRight} - # scroll on the toolbar to change current window OnToolbar Mouse4 :PrevWindow {static groups} (workspace=[current]) (iconhidden=no) !! FBCV13 !! OnToolbar Mouse5 :NextWindow {static groups} (workspace=[current]) (iconhidden=no) !! FBCV13 !! # alt + left/right click to move/resize a window -OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving} -OnWindowBorder Move1 :StartMoving +OnWindow Mod1 Mouse1 :If {Matches (Layer=Normal)} {MacroCmd {Raise} {Focus} {StartMoving}} +OnWindow Mod1 Mouse3 :If {Matches (Layer=Normal)} {MacroCmd {Raise} {Focus} {StartResizing NearestCorner}} -OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner} +OnWindowBorder Move1 :StartMoving OnLeftGrip Move1 :StartResizing bottomleft OnRightGrip Move1 :StartResizing bottomright # alt + middle click to lower the window -OnWindow Mod1 Mouse2 :Lower +OnWindow Mod1 Mouse2 :If {Matches (Layer=Normal)} {Lower} # control-click a window's titlebar and drag to attach windows OnTitlebar Control Mouse1 :StartTabbing @@ -59,8 +55,8 @@ Mod4 Tab :NextTab Mod4 Shift Tab :PrevTab # Arrange/Tile Current windows -Mod4 Left :ArrangeWindowsStackRight (Layer=Normal) -Mod4 Right :ArrangeWindowsStackLeft (Layer=Normal) +Mod1 Left :ArrangeWindowsStackRight (Layer=Normal) +Mod1 Right :ArrangeWindowsStackLeft (Layer=Normal) # go to a specific tab in the current window Mod4 1 :Tab 1 @@ -80,23 +76,23 @@ Mod1 F1 :Exec xterm Mod1 F2 :Exec lumina-search # current window commands -Mod1 F4 :Close -Mod1 F5 :Kill -Mod1 F9 :Minimize -Mod1 F10 :Maximize -Mod1 F11 :Fullscreen +Mod1 F4 :If {Matches (Layer=Normal)} {Close} +Mod1 F5 :If {Matches (Layer=Normal)} {Kill} +Mod1 F9 :If {Matches (Layer=Normal)} {Minimize} +Mod1 F10 :If {Matches (Layer=Normal)} {Maximize} +Mod1 F11 :If {Matches (Layer=Normal)} {Fullscreen} # change to previous/next workspace Control Mod1 Left :PrevWorkspace Control Mod1 Right :NextWorkspace # send the current window to previous/next workspace -Mod4 Left :SendToPrevWorkspace -Mod4 Right :SendToNextWorkspace +Mod4 Left :If {Matches (Layer=Normal)} {SendToPrevWorkspace} +Mod4 Right :If {Matches (Layer=Normal)} {SendToNextWorkspace} # send the current window and follow it to previous/next workspace -Control Mod4 Left :TakeToPrevWorkspace -Control Mod4 Right :TakeToNextWorkspace +Control Mod4 Left :If {Matches (Layer=Normal)} {TakeToPrevWorkspace} +Control Mod4 Right :If {Matches (Layer=Normal)} {TakeToNextWorkspace} # change to a specific workspace Control F1 :Workspace 1 @@ -127,19 +123,19 @@ Mod4 F11 :SendToWorkspace 11 Mod4 F12 :SendToWorkspace 12 # send the current window and change to a specific workspace -Control Mod4 F1 :TakeToWorkspace 1 -Control Mod4 F2 :TakeToWorkspace 2 -Control Mod4 F3 :TakeToWorkspace 3 -Control Mod4 F4 :TakeToWorkspace 4 -Control Mod4 F5 :TakeToWorkspace 5 -Control Mod4 F6 :TakeToWorkspace 6 -Control Mod4 F7 :TakeToWorkspace 7 -Control Mod4 F8 :TakeToWorkspace 8 -Control Mod4 F9 :TakeToWorkspace 9 -Control Mod4 F10 :TakeToWorkspace 10 -Control Mod4 F11 :TakeToWorkspace 11 -Control Mod4 F12 :TakeToWorkspace 12 +Control Mod4 F1 :If {Matches (Layer=Normal)} {TakeToWorkspace 1} +Control Mod4 F2 :If {Matches (Layer=Normal)} {TakeToWorkspace 2} +Control Mod4 F3 :If {Matches (Layer=Normal)} {TakeToWorkspace 3} +Control Mod4 F4 :If {Matches (Layer=Normal)} {TakeToWorkspace 4} +Control Mod4 F5 :If {Matches (Layer=Normal)} {TakeToWorkspace 5} +Control Mod4 F6 :If {Matches (Layer=Normal)} {TakeToWorkspace 6} +Control Mod4 F7 :If {Matches (Layer=Normal)} {TakeToWorkspace 7} +Control Mod4 F8 :If {Matches (Layer=Normal)} {TakeToWorkspace 8} +Control Mod4 F9 :If {Matches (Layer=Normal)} {TakeToWorkspace 9} +Control Mod4 F10 :If {Matches (Layer=Normal)} {TakeToWorkspace 10} +Control Mod4 F11 :If {Matches (Layer=Normal)} {TakeToWorkspace 11} +Control Mod4 F12 :If {Matches (Layer=Normal)} {TakeToWorkspace 12} Print :Exec lumina-screenshot - +Pause :Exec xscreensaver-command -lock diff --git a/lumina-desktop/lumina-desktop.pro b/lumina-desktop/lumina-desktop.pro index 204a449b..dc20fd98 100644 --- a/lumina-desktop/lumina-desktop.pro +++ b/lumina-desktop/lumina-desktop.pro @@ -216,3 +216,7 @@ dotrans.path=$$PREFIX/share/Lumina-DE/i18n/ dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/ INSTALLS += target desktop icons wallpapers defaults conf fluxconf dotrans + +NO_I18N{ + INSTALLS -= dotrans +}
\ No newline at end of file diff --git a/lumina-fileinfo/lumina-fileinfo.pro b/lumina-fileinfo/lumina-fileinfo.pro index c90dd5a4..8e04136f 100644 --- a/lumina-fileinfo/lumina-fileinfo.pro +++ b/lumina-fileinfo/lumina-fileinfo.pro @@ -106,3 +106,7 @@ dotrans.path=$$PREFIX/share/Lumina-DE/i18n/ dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/ INSTALLS += target dotrans + +NO_I18N{ + INSTALLS -= dotrans +}
\ No newline at end of file diff --git a/lumina-fm/lumina-fm.pro b/lumina-fm/lumina-fm.pro index 53e2dd2d..ed3b49ec 100644 --- a/lumina-fm/lumina-fm.pro +++ b/lumina-fm/lumina-fm.pro @@ -116,3 +116,7 @@ desktop.files=lumina-fm.desktop desktop.path=$$PREFIX/share/applications/ INSTALLS += target dotrans desktop + +NO_I18N{ + INSTALLS -= dotrans +}
\ No newline at end of file diff --git a/lumina-info/lumina-info.pro b/lumina-info/lumina-info.pro index 3ae3cb0a..509bf7ad 100644 --- a/lumina-info/lumina-info.pro +++ b/lumina-info/lumina-info.pro @@ -105,3 +105,7 @@ desktop.files=lumina-info.desktop desktop.path=$$PREFIX/share/applications/ INSTALLS += target dotrans desktop + +NO_I18N{ + INSTALLS -= dotrans +}
\ No newline at end of file diff --git a/lumina-open/lumina-open.pro b/lumina-open/lumina-open.pro index ade86be1..ded03086 100644 --- a/lumina-open/lumina-open.pro +++ b/lumina-open/lumina-open.pro @@ -102,3 +102,7 @@ dotrans.path=$$PREFIX/share/Lumina-DE/i18n/ dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/ INSTALLS += target dotrans + +NO_I18N{ + INSTALLS -= dotrans +} diff --git a/lumina-screenshot/lumina-screenshot.pro b/lumina-screenshot/lumina-screenshot.pro index fd3609f3..ee71bfa6 100644 --- a/lumina-screenshot/lumina-screenshot.pro +++ b/lumina-screenshot/lumina-screenshot.pro @@ -104,3 +104,7 @@ desktop.files=lumina-screenshot.desktop desktop.path=$$PREFIX/share/applications/ INSTALLS += target dotrans desktop + +NO_I18N{ + INSTALLS -= dotrans +}
\ No newline at end of file diff --git a/lumina-search/lumina-search.pro b/lumina-search/lumina-search.pro index e738b5db..92c95a14 100644 --- a/lumina-search/lumina-search.pro +++ b/lumina-search/lumina-search.pro @@ -110,3 +110,7 @@ desktop.files=lumina-search.desktop desktop.path=$$PREFIX/share/applications/ INSTALLS += target dotrans desktop + +NO_I18N{ + INSTALLS -= dotrans +}
\ No newline at end of file diff --git a/lumina-wm-INCOMPLETE/DEPENDENCIES b/lumina-wm-INCOMPLETE/DEPENDENCIES new file mode 100644 index 00000000..63b18ab7 --- /dev/null +++ b/lumina-wm-INCOMPLETE/DEPENDENCIES @@ -0,0 +1,17 @@ +Most dependencies required to build Lumina are listed in the +DEPENDENCIES file in the directory above this one. The following +are dependencies specific to Lumina's window manager. + + +FreeBSD/PC-BSD +======================= + + + + +Linux (Debian/Ubuntu) +======================= + +libxcb-screensaver0-dev + + diff --git a/lumina-wm-INCOMPLETE/lumina-wm.pro b/lumina-wm-INCOMPLETE/lumina-wm.pro index 4ca61987..3c680799 100644 --- a/lumina-wm-INCOMPLETE/lumina-wm.pro +++ b/lumina-wm-INCOMPLETE/lumina-wm.pro @@ -106,3 +106,7 @@ dotrans.path=$$PREFIX/share/Lumina-DE/i18n/ dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/ INSTALLS += target dotrans + +NO_I18N{ + INSTALLS -= dotrans +} diff --git a/lumina-xconfig/lumina-xconfig.pro b/lumina-xconfig/lumina-xconfig.pro index 9b15459b..139f2bd5 100644 --- a/lumina-xconfig/lumina-xconfig.pro +++ b/lumina-xconfig/lumina-xconfig.pro @@ -104,3 +104,7 @@ dotrans.path=$$PREFIX/share/Lumina-DE/i18n/ dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/ INSTALLS += target dotrans + +NO_I18N{ + INSTALLS -= dotrans +} |