diff options
author | Ken Moore <moorekou@gmail.com> | 2015-08-05 09:30:14 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-08-05 09:30:14 -0400 |
commit | 57230742d2edde716e90e3cb8413744909054c4f (patch) | |
tree | 9ecb827de44742bd8aa72e90caaf6b830b857aa4 /lumina-desktop | |
parent | Oops, committed a temporary change to include the xcb-render library (not nec... (diff) | |
download | lumina-57230742d2edde716e90e3cb8413744909054c4f.tar.gz lumina-57230742d2edde716e90e3cb8413744909054c4f.tar.bz2 lumina-57230742d2edde716e90e3cb8413744909054c4f.zip |
Finish converting libLumina to XCB-only and finish replacing any LX11 functions in lumina-desktop.
Diffstat (limited to 'lumina-desktop')
4 files changed, 19 insertions, 33 deletions
diff --git a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp index 7ab2fda1..a1de725d 100644 --- a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp +++ b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp @@ -5,6 +5,7 @@ // See the LICENSE file for full details //=========================================== #include "LDesktopSwitcher.h" +#include <LSession.h> LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal) { iconOld = -1; @@ -114,8 +115,8 @@ QAction* LDesktopSwitcher::newAction(int what, QString name) { } void LDesktopSwitcher::createMenu() { - int cur = LX11::GetCurrentDesktop(); //current desktop number - int tot = LX11::GetNumberOfDesktops(); //total number of desktops + int cur = LSession::handle()->XCB->CurrentWorkspace(); //current desktop number + int tot = LSession::handle()->XCB->NumberOfWorkspaces(); //total number of desktops //qDebug() << "-- vor getCurrentDesktop SWITCH"; qDebug() << "Virtual Desktops:" << tot << cur; menu->clear(); @@ -127,7 +128,7 @@ void LDesktopSwitcher::createMenu() { } void LDesktopSwitcher::menuActionTriggered(QAction* act) { - LX11::SetCurrentDesktop(act->whatsThis().toInt()); + LSession::handle()->XCB->SetCurrentWorkspace(act->whatsThis().toInt()); label->setToolTip(QString(tr("Workspace %1")).arg(act->whatsThis().toInt() +1)); QTimer::singleShot(500, this, SLOT(createMenu()) ); //make sure the menu gets updated } diff --git a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp index c45687cd..8ce01c06 100644 --- a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp +++ b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp @@ -114,8 +114,8 @@ void LSysMenuQuick::UpdateMenu(){ ui->group_battery->setVisible(false); } //Workspace - val = LX11::GetCurrentDesktop(); - int tot = LX11::GetNumberOfDesktops(); + val = LSession::handle()->XCB->CurrentWorkspace(); + int tot = LSession::handle()->XCB->NumberOfWorkspaces(); ui->group_workspace->setVisible(val>=0 && tot>1); ui->label_wk_text->setText( QString(tr("%1 of %2")).arg(QString::number(val+1), QString::number(tot)) ); } @@ -157,20 +157,22 @@ void LSysMenuQuick::setCurrentBrightness(){ } void LSysMenuQuick::nextWorkspace(){ - int cur = LX11::GetCurrentDesktop(); - int tot = LX11::GetNumberOfDesktops(); + int cur = LSession::handle()->XCB->CurrentWorkspace(); + int tot = LSession::handle()->XCB->NumberOfWorkspaces(); + //qDebug()<< "Next Workspace:" << cur << tot; cur++; if(cur>=tot){ cur = 0; } //back to beginning - LX11::SetCurrentDesktop(cur); + //qDebug() << " - New Current:" << cur; + LSession::handle()->XCB->SetCurrentWorkspace(cur); ui->label_wk_text->setText( QString(tr("%1 of %2")).arg(QString::number(cur+1), QString::number(tot)) ); } void LSysMenuQuick::prevWorkspace(){ - int cur = LX11::GetCurrentDesktop(); - int tot = LX11::GetNumberOfDesktops(); + int cur = LSession::handle()->XCB->CurrentWorkspace(); + int tot = LSession::handle()->XCB->NumberOfWorkspaces(); cur--; if(cur<0){ cur = tot-1; } //back to last - LX11::SetCurrentDesktop(cur); + LSession::handle()->XCB->SetCurrentWorkspace(cur); ui->label_wk_text->setText( QString(tr("%1 of %2")).arg(QString::number(cur+1), QString::number(tot)) ); } diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index e9e45872..6f324e7a 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -1,22 +1,14 @@ //=========================================== // Lumina-DE source code -// Copyright (c) 2014, Ken Moore +// Copyright (c) 2014-2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #include "TrayIcon.h" -//#include <X11/Xlib.h> -//#include <X11/Xutil.h> -//#include <X11/extensions/Xdamage.h> - -//#include <xcb/damage.h> -//static xcb_damage_damage_t dmgID; - #include <LSession.h> #include <QScreen> #include <LuminaX11.h> -//static int dmgID = 0; TrayIcon::TrayIcon(QWidget *parent) : QWidget(parent){ AID = 0; //nothing yet @@ -25,9 +17,6 @@ TrayIcon::TrayIcon(QWidget *parent) : QWidget(parent){ } TrayIcon::~TrayIcon(){ - /*if(AID!=0){ - detachApp(); - }*/ } WId TrayIcon::appID(){ @@ -41,13 +30,11 @@ void TrayIcon::attachApp(WId id){ IID = this->winId(); //embed directly into this widget dmgID = LSession::handle()->XCB->EmbedWindow(AID, IID); if( dmgID != 0 ){ - LX11::RestoreWindow(AID); //make it visible - //dmgID = XDamageCreate( QX11Info::display(), AID, XDamageReportRawRectangles ); + LSession::handle()->XCB->RestoreWindow(AID); //make it visible qDebug() << "New System Tray App:" << AID; QTimer::singleShot(1000, this, SLOT(updateIcon()) ); }else{ qWarning() << "Could not Embed Tray Application:" << AID; - //LX11::DestroyWindow(IID); IID = 0; AID = 0; } @@ -69,11 +56,7 @@ void TrayIcon::detachApp(){ //Now detach the application window and clean up qDebug() << " - Unembed"; LSession::handle()->XCB->UnembedWindow(tmp); - //if(dmgID!=0){ - //XDamageDestroy(QX11Info::display(), dmgID); - //} qDebug() << " - finished app:" << tmp; - //if(IID!=this->winId()){ LX11::DestroyWindow(IID); } IID = 0; } @@ -84,7 +67,7 @@ void TrayIcon::updateIcon(){ if(AID==0){ return; } //Make sure the icon is square QSize icosize = this->size(); - LX11::ResizeWindow(AID, icosize.width(), icosize.height()); + LSession::handle()->XCB->ResizeWindow(AID, icosize.width(), icosize.height()); QTimer::singleShot(500, this, SLOT(update()) ); //make sure to re-draw the window in a moment } @@ -122,7 +105,7 @@ void TrayIcon::paintEvent(QPaintEvent *event){ void TrayIcon::resizeEvent(QResizeEvent *event){ //qDebug() << "Resize Event:" << event->size().width() << event->size().height(); if(AID!=0){ - LX11::ResizeWindow(AID, event->size().width(), event->size().height()); + LSession::handle()->XCB->ResizeWindow(AID, event->size()); QTimer::singleShot(500, this, SLOT(update()) ); //make sure to re-draw the window in a moment } } diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp index 9da86da8..79a164b8 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp @@ -84,7 +84,7 @@ void LTaskManagerPlugin::UpdateButtons(){ //New windows, create buttons for each (add grouping later) if(updating > ctime){ return; } //another thread kicked off already - stop this one //Check for a button that this can just be added to - QString ctxt = LX11::WindowClass(winlist[i]); + QString ctxt = LSession::handle()->XCB->WindowClass(winlist[i]); bool found = false; for(int b=0; b<BUTTONS.length(); b++){ if(updating > ctime){ return; } //another thread kicked off already - stop this one |