aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/libLumina/NativeEmbedWidget.cpp24
-rw-r--r--src-qt5/core/libLumina/RootWindow.cpp4
-rw-r--r--src-qt5/core/lumina-desktop-unified/LSession.cpp3
-rw-r--r--src-qt5/core/lumina-desktop-unified/main.cpp2
4 files changed, 22 insertions, 11 deletions
diff --git a/src-qt5/core/libLumina/NativeEmbedWidget.cpp b/src-qt5/core/libLumina/NativeEmbedWidget.cpp
index 41a036a2..3472c61e 100644
--- a/src-qt5/core/libLumina/NativeEmbedWidget.cpp
+++ b/src-qt5/core/libLumina/NativeEmbedWidget.cpp
@@ -43,7 +43,8 @@ void NativeEmbedWidget::syncWinSize(QSize sz){
else if(!sz.isValid()){ sz = this->size(); } //use the current widget size
//qDebug() << "Sync Window Size:" << sz;
//if(sz == winSize){ return; } //no change
- QPoint pt= this->mapToGlobal(QPoint(0,0));
+ QPoint pt(0,0);
+ if(!DISABLE_COMPOSITING){ pt = this->mapToGlobal(QPoint(0,0)); }
const uint32_t valList[4] = {(uint32_t) pt.x(), (uint32_t) pt.y(), (uint32_t) sz.width(), (uint32_t) sz.height()};
const uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
xcb_configure_window(QX11Info::connection(), WIN->id(), mask, valList);
@@ -68,14 +69,22 @@ void NativeEmbedWidget::showWindow(){
QImage NativeEmbedWidget::windowImage(QRect geom){
//Pull the XCB pixmap out of the compositing layer
xcb_pixmap_t pix = xcb_generate_id(QX11Info::connection());
- xcb_composite_name_window_pixmap(QX11Info::connection(), WIN->id(), pix);
- if(pix==0){ qDebug() << "Got blank pixmap!"; return QImage(); }
+ /*xcb_composite_get_overlay_window_reply_t *wreply = xcb_composite_get_overlay_window_reply( QX11Info::connection(),
+ xcb_composite_get_overlay_window_unchecked(QX11Info::connection(), WIN->id()), NULL);
+ if(wreply!=0){
+ xcb_composite_name_window_pixmap(QX11Info::connection(), wreply->overlay_win, pix);
+ free(wreply);
+ }else{*/
+ xcb_composite_name_window_pixmap(QX11Info::connection(), WIN->id(), pix);
+ //}
+ if(pix==0){ qDebug() << "Got blank pixmap!"; return QImage(); }
//Convert this pixmap into a QImage
- xcb_image_t *ximg = xcb_image_get(QX11Info::connection(), pix, geom.x(), geom.y(), geom.width(), geom.height(), ~0, XCB_IMAGE_FORMAT_Z_PIXMAP);
+ xcb_image_t *ximg = xcb_image_get(QX11Info::connection(), pix, 0, 0, this->width(), this->height(), ~0, XCB_IMAGE_FORMAT_Z_PIXMAP);
+ //xcb_image_t *ximg = xcb_image_get(QX11Info::connection(), pix, geom.x(), geom.y(), geom.width(), geom.height(), ~0, XCB_IMAGE_FORMAT_Z_PIXMAP);
if(ximg == 0){ qDebug() << "Got blank image!"; return QImage(); }
QImage img(ximg->data, ximg->width, ximg->height, ximg->stride, QImage::Format_ARGB32_Premultiplied);
- img = img.copy(); //detach this image from the XCB data structures
+ img = img.copy(); //detach this image from the XCB data structures before we clean them up
xcb_image_destroy(ximg);
//Cleanup the XCB data structures
@@ -97,7 +106,6 @@ NativeEmbedWidget::NativeEmbedWidget(QWidget *parent) : QWidget(parent){
bool NativeEmbedWidget::embedWindow(NativeWindow *window){
WIN = window;
- //xcb_reparent_window(QX11Info::connection(), WIN->id(), this->winId(), 0, 0);
//Now send the embed event to the app
//qDebug() << " - send _XEMBED event";
@@ -117,7 +125,7 @@ bool NativeEmbedWidget::embedWindow(NativeWindow *window){
//Now setup any redirects and return
if(!DISABLE_COMPOSITING){
xcb_composite_redirect_window(QX11Info::connection(), WIN->id(), XCB_COMPOSITE_REDIRECT_MANUAL); //XCB_COMPOSITE_REDIRECT_[MANUAL/AUTOMATIC]);
- xcb_composite_redirect_subwindows(QX11Info::connection(), WIN->id(), XCB_COMPOSITE_REDIRECT_MANUAL); //XCB_COMPOSITE_REDIRECT_[MANUAL/AUTOMATIC]);
+ xcb_composite_redirect_subwindows(QX11Info::connection(), WIN->id(), XCB_COMPOSITE_REDIRECT_MANUAL); //AUTOMATIC); //XCB_COMPOSITE_REDIRECT_[MANUAL/AUTOMATIC]);
//Now create/register the damage handler
// -- XCB (Note: The XCB damage registration is completely broken at the moment - 9/15/15, Ken Moore)
@@ -128,6 +136,8 @@ bool NativeEmbedWidget::embedWindow(NativeWindow *window){
Damage dmgID = XDamageCreate(QX11Info::display(), WIN->id(), XDamageReportRawRectangles);
WIN->addDamageID( (uint) dmgID); //save this for later
+ }else{
+ xcb_reparent_window(QX11Info::connection(), WIN->id(), this->winId(), 0, 0);
}
WIN->addFrameWinID(this->winId());
connect(WIN, SIGNAL(VisualChanged()), this, SLOT(repaintWindow()) ); //make sure we repaint the widget on visual change
diff --git a/src-qt5/core/libLumina/RootWindow.cpp b/src-qt5/core/libLumina/RootWindow.cpp
index b0d07600..996b8e01 100644
--- a/src-qt5/core/libLumina/RootWindow.cpp
+++ b/src-qt5/core/libLumina/RootWindow.cpp
@@ -220,11 +220,11 @@ void RootWindow::CloseWindow(WId win){
// === PROTECTED ===
void RootWindow::paintEvent(QPaintEvent *ev){
//qDebug() << "RootWindow: PaintEvent:" << ev->rect(); //<< QDateTime::currentDateTime()->toString(QDateTime::ShortDate);
- QWidget::paintEvent(ev);
+ //QWidget::paintEvent(ev);
bool found = false;
QPainter painter(this);
QRect geom = ev->rect();
- geom.adjust(-10,-10,10,10); //give it a few more pixels in each direction to repaint (noticing some issues in Qt 5.7.1)
+ geom.adjust(-100,-100,100,100); //give it a few more pixels in each direction to repaint (noticing some issues in Qt 5.7.1)
for(int i=0; i<WALLPAPERS.length(); i++){
if(WALLPAPERS[i].area.intersects(geom) ){
found = true;
diff --git a/src-qt5/core/lumina-desktop-unified/LSession.cpp b/src-qt5/core/lumina-desktop-unified/LSession.cpp
index bee12180..ef1e2828 100644
--- a/src-qt5/core/lumina-desktop-unified/LSession.cpp
+++ b/src-qt5/core/lumina-desktop-unified/LSession.cpp
@@ -28,6 +28,7 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu
qRegisterMetaType< Qt::Key >("Qt::Key");
qRegisterMetaType< NativeWindow::Property >("NativeWindow::Property");
qRegisterMetaType< QList< NativeWindow::Property > >("QList<NativeWindow::Property>");
+ qRegisterMetaType< NativeWindowSystem::MouseButton >("NativeWindowSystem::MouseButton");
mediaObj = 0; //private object used for playing login/logout chimes
if(this->isPrimaryProcess()){
@@ -289,7 +290,7 @@ void LSession::playAudioFile(QString filepath){
if( !QFile::exists(filepath) ){ return; }
//Setup the audio output systems for the desktop
if(DEBUG){ qDebug() << "Play Audio File"; }
- if(mediaObj==0){ qDebug() << " - Initialize media player"; mediaObj = new QMediaPlayer(); }
+ if(mediaObj==0){ qDebug() << " - Initialize media player"; mediaObj = new QMediaPlayer(0,QMediaPlayer::LowLatency); }
if(mediaObj !=0 ){
if(DEBUG){ qDebug() << " - starting playback:" << filepath; }
mediaObj->setVolume(100);
diff --git a/src-qt5/core/lumina-desktop-unified/main.cpp b/src-qt5/core/lumina-desktop-unified/main.cpp
index ef15cfcd..ed2b9b4c 100644
--- a/src-qt5/core/lumina-desktop-unified/main.cpp
+++ b/src-qt5/core/lumina-desktop-unified/main.cpp
@@ -29,7 +29,7 @@ int main(int argc, char ** argv)
setenv("DESKTOP_SESSION","Lumina",1);
setenv("XDG_CURRENT_DESKTOP","Lumina",1);
setenv("QT_NO_GLIB", "1", 1); //Disable the glib event loop within Qt at runtime (performance hit + bugs)
- //unsetenv("QT_QPA_PLATFORMTHEME"); //causes issues with Lumina themes - not many people have this by default...
+ setenv("QT_QPA_PLATFORMTHEME", "lthemeengine",1); //causes issues with Lumina themes - not many people have this by default...
unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); //need exact-pixel measurements (no fake scaling)
//Startup the session
bgstack15