diff options
author | q5sys <jt@ixsystems.com> | 2017-09-20 12:23:40 -0400 |
---|---|---|
committer | q5sys <jt@ixsystems.com> | 2017-09-20 12:23:40 -0400 |
commit | f7a4440c81397051cebef64fbb9fb5b65a5eea2f (patch) | |
tree | af804a0084544c970c13febfd00a0b0e60d6a050 | |
parent | set LTE unsaved changes close dialog to follow the industry standard (diff) | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-f7a4440c81397051cebef64fbb9fb5b65a5eea2f.tar.gz lumina-f7a4440c81397051cebef64fbb9fb5b65a5eea2f.tar.bz2 lumina-f7a4440c81397051cebef64fbb9fb5b65a5eea2f.zip |
Merge branch 'master' of http://github.com/trueos/lumina
-rw-r--r-- | src-qt5/core/libLumina/NativeEmbedWidget.cpp | 23 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeWindowSystem.cpp | 22 | ||||
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.cpp | 18 | ||||
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.h | 2 | ||||
-rw-r--r-- | src-qt5/core/libLumina/RootWindow.cpp | 2 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/i18n/l-archiver_ca.ts | 66 |
6 files changed, 77 insertions, 56 deletions
diff --git a/src-qt5/core/libLumina/NativeEmbedWidget.cpp b/src-qt5/core/libLumina/NativeEmbedWidget.cpp index ff0f4734..57b6edde 100644 --- a/src-qt5/core/libLumina/NativeEmbedWidget.cpp +++ b/src-qt5/core/libLumina/NativeEmbedWidget.cpp @@ -331,11 +331,13 @@ void NativeEmbedWidget::hideEvent(QHideEvent *ev){ } void NativeEmbedWidget::paintEvent(QPaintEvent *ev){ + QPainter P(this); + P.setClipping(true); + P.setClipRect(0,0,this->width(), this->height()); + P.fillRect(ev->rect(), Qt::transparent); if(WIN==0){ return; } QRect geom = ev->rect(); //atomic updates //qDebug() << "Paint Rect:" << geom; - //geom.adjust(-10,-10,10,10); //add an additional few pixels in each direction to be painted - //geom = geom.intersected(QRect(0,0,this->width(), this->height())); //ensure intersection with actual window QImage img; if(!paused){ img = windowImage(geom); } else if(!winImage.isNull()){ @@ -343,23 +345,8 @@ void NativeEmbedWidget::paintEvent(QPaintEvent *ev){ else{ img = winImage.scaled(geom.size()); } //this is a fast transformation - might be slightly distorted } //Need to paint the image from the window onto the widget as an overlay + P.drawImage( geom , img, QRect(QPoint(0,0), img.size()), Qt::NoOpaqueDetection); //1-to-1 mapping - QPainter P(this); - P.setClipping(true); - P.setClipRect(0,0,this->width(), this->height()); - //if(DISABLE_COMPOSITING){ P.fillRect(geom, Qt::black); } //get weird effects when partial-compositing is enabled if you layer transparent window frames above other windows - //qDebug() << "Paint Embed Window:" << geom << winImage.size(); - //if(winImage.size() == this->size()){ - P.drawImage( geom , img, QRect(QPoint(0,0), img.size()), Qt::NoOpaqueDetection); //1-to-1 mapping - //Note: Qt::NoOpaqueDetection Speeds up the paint by bypassing the checks to see if there are [semi-]transparent pixels - // Since this is an embedded image - we fully expect there to be transparency all/most of the time. - // }else{ - //P.drawImage( geom , winImage); //auto-scale it to fit (transforming a static image while paused?) - // } - //else{ QImage scaled = winImage.scaled(geom.size()); P.drawImage(geom, scaled); } - //P.drawImage( geom , winImage, geom, Qt::NoOpaqueDetection); //1-to-1 mapping - //Note: Qt::NoOpaqueDetection Speeds up the paint by bypassing the checks to see if there are [semi-]transparent pixels - // Since this is an embedded image - we fully expect there to be transparency all/most of the time. } diff --git a/src-qt5/core/libLumina/NativeWindowSystem.cpp b/src-qt5/core/libLumina/NativeWindowSystem.cpp index 0ee65929..e8e9655a 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.cpp +++ b/src-qt5/core/libLumina/NativeWindowSystem.cpp @@ -492,7 +492,27 @@ void NativeWindowSystem::UpdateWindowProperties(NativeWindow* win, QList< Native } if(props.contains(NativeWindow::WinTypes)){ QList< NativeWindow::Type> types; - types << NativeWindow::T_NORMAL; //make this load appropriately later + xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_window_type_unchecked(&obj->EWMH, win->id()); + xcb_ewmh_get_atoms_reply_t reply; + if(1==xcb_ewmh_get_wm_window_type_reply(&obj->EWMH, cookie, &reply, NULL) ){ + for(unsigned int i=0; i<reply.atoms_len; i++){ + if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DESKTOP){ types << NativeWindow::T_DESKTOP; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DOCK){ types << NativeWindow::T_DOCK; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_TOOLBAR){ types << NativeWindow::T_TOOLBAR; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_MENU){ types << NativeWindow::T_MENU; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_UTILITY){ types << NativeWindow::T_UTILITY; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_SPLASH){ types << NativeWindow::T_SPLASH; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DIALOG){ types << NativeWindow::T_DIALOG; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DROPDOWN_MENU){ types << NativeWindow::T_DROPDOWN_MENU; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_POPUP_MENU){ types << NativeWindow::T_POPUP_MENU; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_TOOLTIP){ types << NativeWindow::T_TOOLTIP; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_NOTIFICATION){ types << NativeWindow::T_NOTIFICATION; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_COMBO){ types << NativeWindow::T_COMBO; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_DND){ types << NativeWindow::T_DND; } + else if(reply.atoms[i]==obj->EWMH._NET_WM_WINDOW_TYPE_NORMAL){ types << NativeWindow::T_NORMAL; } + } + } + if(types.isEmpty()){ types << NativeWindow::T_NORMAL; } win->setProperty(NativeWindow::WinTypes, QVariant::fromValue< QList<NativeWindow::Type> >(types) ); } } diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp index 5fb8ece4..5040f2f9 100644 --- a/src-qt5/core/libLumina/RootSubWindow.cpp +++ b/src-qt5/core/libLumina/RootSubWindow.cpp @@ -242,6 +242,16 @@ void RootSubWindow::enableFrame(bool on){ WIN->setProperty(NativeWindow::FrameExtents, QVariant::fromValue< QList<int> >(extents) ); //save to structure now } +void RootSubWindow::enableFrame(QList<NativeWindow::Type> types){ + static QList<NativeWindow::Type> noframe; + if(noframe.isEmpty()){ noframe << NativeWindow::T_DESKTOP << NativeWindow::T_DOCK << NativeWindow::T_TOOLBAR << NativeWindow::T_MENU << NativeWindow::T_SPLASH << NativeWindow::T_DROPDOWN_MENU << NativeWindow::T_POPUP_MENU << NativeWindow::T_TOOLTIP << NativeWindow::T_NOTIFICATION << NativeWindow::T_COMBO << NativeWindow::T_DND; } + for(int i=0; i<types.length(); i++){ + if(noframe.contains(types[i])){ enableFrame(false); return; } + } + enableFrame(true); + //Now make buttons visible as appropriate for the type + //NativeWindow::T_UTILITY, NativeWindow::T_DIALOG, , NativeWindow::T_NORMAL +} void RootSubWindow::LoadProperties( QList< NativeWindow::Property> list){ QList<QVariant> vals; //Always ensure that visibility changes are evaluated last @@ -370,7 +380,7 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList switch(props[i]){ case NativeWindow::Visible: if(!WinWidget->isPaused() && (this->isVisible()!=vals[i].toBool()) && activeState==Normal ){ - qDebug() << "Got Visibility Change:" << vals[i] << this->geometry() << WIN->geometry(); + //qDebug() << "Got Visibility Change:" << vals[i] << this->geometry() << WIN->geometry(); if(vals[i].toBool()){ loadAnimation( DesktopSettings::instance()->value(DesktopSettings::Animation, "window/appear", "random").toString(), NativeWindow::Visible, vals[i]); } else{ loadAnimation( DesktopSettings::instance()->value(DesktopSettings::Animation, "window/disappear", "random").toString(), NativeWindow::Visible, vals[i]); } } @@ -397,7 +407,7 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList i--; }else if(!WinWidget->isPaused() && activeState==Normal){ if(WIN->property(NativeWindow::Size).toSize() != WinWidget->size()){ - qDebug() << "Got Direct Geometry Change:" << WIN->geometry(); + //qDebug() << "Got Direct Geometry Change:" << WIN->geometry(); this->setGeometry( QRect(this->geometry().topLeft(), WIN->geometry().size()) ); WinWidget->resyncWindow(); } @@ -434,8 +444,8 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList mainLayout->setContentsMargins( vals[i].value< QList<int> >().at(0),vals[i].value< QList<int> >().at(2) - titleLabel->height(),vals[i].value< QList<int> >().at(1),vals[i].value< QList<int> >().at(3)); break;*/ case NativeWindow::WinTypes: - qDebug() << "Got Window Types:" << vals[i].value< QList<NativeWindow::Type> >(); - enableFrame(vals[i].value< QList<NativeWindow::Type> >().contains(NativeWindow::T_NORMAL) ); + //qDebug() << "Got Window Types:" << vals[i].value< QList<NativeWindow::Type> >(); + enableFrame(vals[i].value< QList<NativeWindow::Type> >() ); break; default: qDebug() << "Window Property Unused:" << props[i] << vals[i]; diff --git a/src-qt5/core/libLumina/RootSubWindow.h b/src-qt5/core/libLumina/RootSubWindow.h index c1964724..598298e2 100644 --- a/src-qt5/core/libLumina/RootSubWindow.h +++ b/src-qt5/core/libLumina/RootSubWindow.h @@ -59,12 +59,14 @@ private: void initWindowFrame(); void enableFrame(bool); + void enableFrame(QList<NativeWindow::Type> types); void LoadProperties( QList< NativeWindow::Property> list); static QStringList validAnimations(NativeWindow::Property); public slots: + void ensureVisible(){ WIN->setProperty(NativeWindow::Visible, true); } void giveMouseFocus(){ WinWidget->raiseWindow(); } void removeMouseFocus(){ WinWidget->lowerWindow(); } void giveKeyboardFocus(){ WIN->requestProperty(NativeWindow::Active, true, true); } diff --git a/src-qt5/core/libLumina/RootWindow.cpp b/src-qt5/core/libLumina/RootWindow.cpp index fdbc1eb8..705297be 100644 --- a/src-qt5/core/libLumina/RootWindow.cpp +++ b/src-qt5/core/libLumina/RootWindow.cpp @@ -239,7 +239,9 @@ void RootWindow::NewWindow(NativeWindow *win){ connect(subwin, SIGNAL(windowAnimFinished()), this, SLOT(checkMouseFocus()) ); WINDOWS << subwin; } + //QApplication::processEvents(); CheckWindowPosition(win->id(), true); //first-time run + //QTimer::singleShot(300, subwin, SLOT(ensureVisible())); win->setProperty(NativeWindow::Visible, true); //win->requestProperty( NativeWindow::Active, true); //win->requestProperties(QList<NativeWindow::Property>() << NativeWindow::Visible << NativeWindow::Active, QList<QVariant>() << true << true, true); diff --git a/src-qt5/desktop-utils/lumina-archiver/i18n/l-archiver_ca.ts b/src-qt5/desktop-utils/lumina-archiver/i18n/l-archiver_ca.ts index 98930879..f39823f0 100644 --- a/src-qt5/desktop-utils/lumina-archiver/i18n/l-archiver_ca.ts +++ b/src-qt5/desktop-utils/lumina-archiver/i18n/l-archiver_ca.ts @@ -6,7 +6,7 @@ <message> <location filename="../TarBackend.cpp" line="229"/> <source>Could not read archive</source> - <translation>No s'ha pogut llegir l'arxiu</translation> + <translation>No s'ha pogut llegir l'arxiu</translation> </message> <message> <location filename="../TarBackend.cpp" line="231"/> @@ -81,7 +81,7 @@ <message> <location filename="../MainUI.ui" line="202"/> <source>Add files to archive</source> - <translation>Afegiu fitxers a l'arxiu</translation> + <translation>Afegiu fitxers a l'arxiu</translation> </message> <message> <location filename="../MainUI.ui" line="207"/> @@ -91,7 +91,7 @@ <message> <location filename="../MainUI.ui" line="210"/> <source>Remove selection from archive</source> - <translation>Elimina la selecció de l'arxiu</translation> + <translation>Elimina la selecció de l'arxiu</translation> </message> <message> <location filename="../MainUI.ui" line="215"/> @@ -101,7 +101,7 @@ <message> <location filename="../MainUI.ui" line="218"/> <source>Extract archive into a directory</source> - <translation>Extreu l'arxiu en un directori</translation> + <translation>Extreu l'arxiu en un directori</translation> </message> <message> <location filename="../MainUI.ui" line="223"/> @@ -111,7 +111,7 @@ <message> <location filename="../MainUI.ui" line="226"/> <source>Add directory to archive</source> - <translation>Afegeix un directori a l'arxiu</translation> + <translation>Afegeix un directori a l'arxiu</translation> </message> <message> <location filename="../MainUI.ui" line="231"/> @@ -131,17 +131,17 @@ <message> <location filename="../MainUI.ui" line="242"/> <source>Copy an IMG to a USB device (may require admin permission)</source> - <translation>Copia una IMG en un dispositiu USB (pot caldre permís d'administrador)</translation> + <translation>Copia una IMG en un dispositiu USB (pot caldre permís d'administrador)</translation> </message> <message> <location filename="../MainUI.cpp" line="24"/> <source>Archive Manager</source> - <translation>Gestor d'arxius</translation> + <translation>Gestor d'arxius</translation> </message> <message> <location filename="../MainUI.cpp" line="25"/> <source>Admin Mode</source> - <translation>Mode d'administrador</translation> + <translation>Mode d'administrador</translation> </message> <message> <location filename="../MainUI.cpp" line="51"/> @@ -179,7 +179,7 @@ <location filename="../MainUI.cpp" line="81"/> <location filename="../MainUI.cpp" line="220"/> <source>Opening Archive...</source> - <translation>S'obre l'arxiu...</translation> + <translation>S'obre l'arxiu...</translation> </message> <message> <location filename="../MainUI.cpp" line="164"/> @@ -301,7 +301,7 @@ <message> <location filename="../MainUI.cpp" line="210"/> <source>Could not overwrite file:</source> - <translation>No s'ha pogut sobreescriure el fitxer:</translation> + <translation>No s'ha pogut sobreescriure el fitxer:</translation> </message> <message> <location filename="../MainUI.cpp" line="218"/> @@ -312,18 +312,18 @@ <location filename="../MainUI.cpp" line="226"/> <location filename="../MainUI.cpp" line="233"/> <source>Add to Archive</source> - <translation>Afegeix a l'arxiu</translation> + <translation>Afegeix a l'arxiu</translation> </message> <message> <location filename="../MainUI.cpp" line="228"/> <location filename="../MainUI.cpp" line="235"/> <source>Adding Items...</source> - <translation>S'afegeixen elements...</translation> + <translation>S'afegeixen elements...</translation> </message> <message> <location filename="../MainUI.cpp" line="246"/> <source>Removing Items...</source> - <translation>S'eliminen elements...</translation> + <translation>S'eliminen elements...</translation> </message> <message> <location filename="../MainUI.cpp" line="251"/> @@ -337,7 +337,7 @@ <location filename="../MainUI.cpp" line="278"/> <location filename="../MainUI.cpp" line="290"/> <source>Extracting...</source> - <translation>S'extreu...</translation> + <translation>S'extreu...</translation> </message> <message> <location filename="../MainUI.cpp" line="310"/> @@ -350,67 +350,67 @@ <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="603"/> <source>Multimedia</source> - <translation type="unfinished"></translation> + <translation>Multimèdia</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="604"/> <source>Development</source> - <translation type="unfinished"></translation> + <translation>Desenvolupament</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="605"/> <source>Education</source> - <translation type="unfinished"></translation> + <translation>Educació</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="606"/> <source>Games</source> - <translation type="unfinished"></translation> + <translation>Jocs</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="607"/> <source>Graphics</source> - <translation type="unfinished"></translation> + <translation>Gràfics</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="608"/> <source>Network</source> - <translation type="unfinished"></translation> + <translation>Xarxa</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="609"/> <source>Office</source> - <translation type="unfinished"></translation> + <translation>Oficina</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="610"/> <source>Science</source> - <translation type="unfinished"></translation> + <translation>Ciència</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="611"/> <source>Settings</source> - <translation type="unfinished"></translation> + <translation>Configuració</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="612"/> <source>System</source> - <translation type="unfinished"></translation> + <translation>Sistema</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="613"/> <source>Utility</source> - <translation type="unfinished"></translation> + <translation>Utilitat</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="614"/> <source>Wine</source> - <translation type="unfinished"></translation> + <translation>Wine</translation> </message> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="615"/> <source>Unsorted</source> - <translation type="unfinished"></translation> + <translation>Sense classificar</translation> </message> </context> <context> @@ -443,7 +443,7 @@ <message> <location filename="../imgDialog.ui" line="108"/> <source>Wipe all extra space on device (conv = sync)</source> - <translation>Neteja tot l'espai extra al dispositiu (conv = sync)</translation> + <translation>Neteja tot l'espai extra al dispositiu (conv = sync)</translation> </message> <message> <location filename="../imgDialog.ui" line="132"/> @@ -473,7 +473,7 @@ <message> <location filename="../imgDialog.cpp" line="22"/> <source>Admin Mode</source> - <translation>Mode d'administrador</translation> + <translation>Mode d'administrador</translation> </message> <message> <location filename="../imgDialog.cpp" line="36"/> @@ -508,12 +508,12 @@ <message> <location filename="../imgDialog.cpp" line="170"/> <source>Administrator Permissions Needed</source> - <translation>Calen permisos d'administrador</translation> + <translation>Calen permisos d'administrador</translation> </message> <message> <location filename="../imgDialog.cpp" line="170"/> <source>This operation requires administrator priviledges.</source> - <translation>Aquesta operació requereix privilegis d'administrador.</translation> + <translation>Aquesta operació requereix privilegis d'administrador.</translation> </message> <message> <location filename="../imgDialog.cpp" line="170"/> @@ -528,7 +528,7 @@ <message> <location filename="../imgDialog.cpp" line="175"/> <source>The process could not be completed:</source> - <translation>El procés no s'ha pogut completar:</translation> + <translation>El procés no s'ha pogut completar:</translation> </message> <message> <location filename="../imgDialog.cpp" line="178"/> @@ -538,7 +538,7 @@ <message> <location filename="../imgDialog.cpp" line="178"/> <source>The image was successfully burned to the USB device</source> - <translation>La imatge s'ha gravat correctament al dispositiu USB.</translation> + <translation>La imatge s'ha gravat correctament al dispositiu USB.</translation> </message> </context> </TS> |