diff options
-rw-r--r-- | libLumina/LuminaX11.cpp | 26 | ||||
-rw-r--r-- | libLumina/LuminaX11.h | 6 | ||||
-rw-r--r-- | libLumina/LuminaXDG.cpp | 4 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp | 6 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp | 2 |
5 files changed, 15 insertions, 29 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp index fcfe0f39..199dd6ed 100644 --- a/libLumina/LuminaX11.cpp +++ b/libLumina/LuminaX11.cpp @@ -518,7 +518,7 @@ QString LX11::WindowVisibleIconName(WId win){ } // ===== WindowIcon() ===== -QIcon LX11::WindowIcon(WId win){ +/*QIcon LX11::WindowIcon(WId win){ //Use the _NET_WM_ICON value instead of the WMHints pixmaps // - the pixmaps are very unstable and erratic QIcon icon; @@ -547,11 +547,11 @@ QIcon LX11::WindowIcon(WId win){ XFree(data); } return icon; -} +}*/ // ===== WindowImage() ===== -QPixmap LX11::WindowImage(WId win, bool useleader){ +/*QPixmap LX11::WindowImage(WId win, bool useleader){ QPixmap pix; Display *disp = QX11Info::display(); WId leader = LX11::leaderWindow(win); //check for an alternate window that contains the image @@ -568,7 +568,7 @@ QPixmap LX11::WindowImage(WId win, bool useleader){ } //Return the pixmap return pix; -} +}*/ // ===== GetNumberOfDesktops() ===== int LX11::WindowDesktop(WId win){ @@ -1108,24 +1108,10 @@ QIcon LXCB::WindowIcon(WId win){ } // === WindowImage() === -QPixmap LXCB::WindowImage(WId win, bool useleader){ +QPixmap LXCB::WindowImage(WId win){ QPixmap pix; - //Display *disp = QX11Info::display(); - /*WId leader = LX11::leaderWindow(win); //check for an alternate window that contains the image - if(leader!=0 && useleader){ win = leader; } //use the leader window instead - //First get the size of the window image (embedded in the window attributes) - XWindowAttributes att; - if( 0 == XGetWindowAttributes(disp, win, &att) ){ return pix; } //invalid window attributes - //Now extract the image - XImage *xim = XGetImage(disp, win, 0,0, att.width, att.height, AllPlanes, ZPixmap); - if(xim!=0){ - //Convert the X image to a Qt Image - pix.convertFromImage( QImage( (const uchar*) xim->data, xim->width, xim->height, xim->bytes_per_line, QImage::Format_ARGB32_Premultiplied) ); - XDestroyImage(xim); //clean up - }*/ + //First get the size of the window - - //xcb_get_window_attributes_reply_t reply; xcb_get_geometry_cookie_t cookie = xcb_get_geometry_unchecked(QX11Info::connection(), win); xcb_get_geometry_reply_t *reply = xcb_get_geometry_reply(QX11Info::connection(), cookie, NULL); if(reply == 0){ return pix; } //could not determine window geometry diff --git a/libLumina/LuminaX11.h b/libLumina/LuminaX11.h index c2e27dcd..cd5f8183 100644 --- a/libLumina/LuminaX11.h +++ b/libLumina/LuminaX11.h @@ -91,8 +91,8 @@ public: static QString WindowVisibleName(WId); // long name (translated) static QString WindowIconName(WId); // short name (untranslated) static QString WindowVisibleIconName(WId); // short name (translated) - static QIcon WindowIcon(WId); // Icon for the window - static QPixmap WindowImage(WId win, bool useleader=true); // Image for the window + //static QIcon WindowIcon(WId); // Icon for the window + //static QPixmap WindowImage(WId win, bool useleader=true); // Image for the window static int WindowDesktop(WId); // Which virtual desktop the window is on static WINDOWSTATE GetWindowState(WId win); //State of activity static WId leaderWindow(WId); //Get the main window if this one is a redirect @@ -139,7 +139,7 @@ public: QString WindowName(WId win); //_WM_NAME bool WindowIsMaximized(WId win); QIcon WindowIcon(WId win); //_NET_WM_ICON - QPixmap WindowImage(WId win, bool useleader=true); //Pull the image directly from the window + QPixmap WindowImage(WId win); //Pull the image directly from the window //Window Modification void SetAsSticky(WId); //Stick to all workspaces diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp index 48abb40a..1756c03b 100644 --- a/libLumina/LuminaXDG.cpp +++ b/libLumina/LuminaXDG.cpp @@ -20,7 +20,7 @@ XDGDesktop LXDG::loadDesktopFile(QString filePath, bool& ok){ DF.isHidden=false; DF.useTerminal=false; DF.startupNotify=false; - DF.type = XDGDesktop::BAD; + DF.type = XDGDesktop::APP; DF.filePath = filePath; DF.exec = DF.tryexec = ""; // just to make sure this is initialized //Check input file path validity @@ -83,7 +83,7 @@ XDGDesktop LXDG::loadDesktopFile(QString filePath, bool& ok){ if(val.toLower()=="application"){ DF.type = XDGDesktop::APP; } else if(val.toLower()=="link"){ DF.type = XDGDesktop::LINK; } else if(val.toLower()=="dir"){ DF.type = XDGDesktop::DIR; } - else{ DF.type = XDGDesktop::BAD; } + else{ DF.type = XDGDesktop::BAD; } //Unknown type } } //end reading file file.close(); diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index ce20c563..e13a1908 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -54,15 +54,15 @@ void DesktopViewPlugin::updateContents(){ bool ok = false; XDGDesktop desk = LXDG::loadDesktopFile(files[i].absoluteFilePath(), ok); if(ok){ - it->setIcon( LXDG::findIcon(desk.icon,"") ); + it->setIcon( LXDG::findIcon(desk.icon,"unknown") ); it->setText( desk.name ); }else{ //Revert back to a standard file handling - it->setIcon( LXDG::findMimeIcon(files[i].suffix()) ); + it->setIcon( LXDG::findMimeIcon(files[i].fileName()) ); it->setText( files[i].fileName() ); } }else{ - it->setIcon( LXDG::findMimeIcon(files[i].suffix()) ); + it->setIcon( LXDG::findMimeIcon( files[i].fileName() ) ); it->setText( files[i].fileName() ); } list->addItem(it); diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index 23453eed..47576478 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -117,7 +117,7 @@ void TrayIcon::paintEvent(QPaintEvent *event){ //qDebug() << " - Draw tray:" << AID << IID << this->winId(); //qDebug() << " - - " << event->rect().x() << event->rect().y() << event->rect().width() << event->rect().height(); //qDebug() << " - Get image:" << AID; - QPixmap pix = LSession::handle()->XCB->WindowImage(AID, false); + QPixmap pix = LSession::handle()->XCB->WindowImage(AID); //LX11::WindowImage(AID, false); if(pix.isNull()){ //Try to grab the window directly with Qt |