diff --git a/CMakeLists.txt b/CMakeLists.txt index fd9ed80353..27f4e66005 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -248,7 +248,6 @@ set(kwin_XCB_LIBS ${XCB_RENDER_LIBRARIES} ${XCB_RANDR_LIBRARIES} ${XCB_KEYSYMS_LIBRARIES} - ${XCB_ICCCM_LIBRARIES} ) set(kwin_WAYLAND_LIBS @@ -309,8 +308,6 @@ if(OPENGL_FOUND) if (DL_LIBRARY) target_link_libraries(kdeinit_kwin ${DL_LIBRARY}) endif() - # must be after opengl, to be initialized first by the linker - target_link_libraries(kdeinit_kwin kwinnvidiahack) elseif(OPENGLES_FOUND) target_link_libraries(kdeinit_kwin ${kwinLibs} kwinglesutils ${OPENGLES_LIBRARIES}) set_target_properties(kdeinit_kwin PROPERTIES COMPILE_FLAGS "-DKWIN_HAVE_OPENGLES") @@ -329,18 +326,6 @@ if(OPENGLES_FOUND) install(TARGETS kwin_gles ${INSTALL_TARGETS_DEFAULT_ARGS} ) endif() -########### next target ############### - -set( kwinnvidiahack_LIB_SRCS - nvidiahack.cpp ) - - -kde4_add_library(kwinnvidiahack SHARED ${kwinnvidiahack_LIB_SRCS}) - -set_target_properties(kwinnvidiahack PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) -set_target_properties(kwinnvidiahack PROPERTIES OUTPUT_NAME ${KWIN_NAME}nvidiahack) -install(TARGETS kwinnvidiahack ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) - ########### install files ############### install( FILES kwin.kcfg DESTINATION ${KCFG_INSTALL_DIR} RENAME ${KWIN_NAME}.kcfg ) diff --git a/activation.cpp b/activation.cpp index f4fce276e8..8b75c0a517 100644 --- a/activation.cpp +++ b/activation.cpp @@ -246,11 +246,20 @@ void Workspace::setActiveClient(Client* c) } active_client = c; Q_ASSERT(c == NULL || c->isActive()); - if (active_client != NULL) - last_active_client = active_client; + if (active_client) { + last_active_client = active_client; FocusChain::self()->update(active_client, FocusChain::MakeFirst); active_client->demandAttention(false); + + // activating a client can cause a non active fullscreen window to loose the ActiveLayer status on > 1 screens + if (screens()->count() > 1) { + for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) { + if (*it != active_client && (*it)->layer() == ActiveLayer && (*it)->screen() == active_client->screen()) { + updateClientLayer(*it); + } + } + } } pending_take_activity = NULL; diff --git a/client.cpp b/client.cpp index 65d1441fdc..afb4920cbf 100644 --- a/client.cpp +++ b/client.cpp @@ -805,7 +805,7 @@ void Client::hideClient(bool hide) */ bool Client::isMinimizable() const { - if (isSpecialWindow()) + if (isSpecialWindow() && !isTransient()) return false; if (!rules()->checkMinimize(true)) return false; @@ -1162,6 +1162,8 @@ void Client::internalKeep() if (old == Unmapped || old == Withdrawn) map(); m_decoInputExtent.unmap(); + if (isActive()) + workspace()->focusToNull(); // get rid of input focus, bug #317484 updateHiddenPreview(); addWorkspaceRepaint(visibleRect()); workspace()->clientHidden(this); diff --git a/clients/aurorae/src/kwindecoration.desktop b/clients/aurorae/src/kwindecoration.desktop index ae92d76073..aa2017c7b3 100644 --- a/clients/aurorae/src/kwindecoration.desktop +++ b/clients/aurorae/src/kwindecoration.desktop @@ -3,6 +3,7 @@ Type=ServiceType X-KDE-ServiceType=KWin/Decoration Comment=KWin Window Decoration +Comment[bs]=KWin Dekoracije prozora Comment[ca]=Decoració de finestres del KWin Comment[ca@valencia]=Decoració de finestres del KWin Comment[cs]=Dekorace oken KWin diff --git a/clients/aurorae/themes/plastik/package/metadata.desktop b/clients/aurorae/themes/plastik/package/metadata.desktop index 3026512036..26fa04729f 100644 --- a/clients/aurorae/themes/plastik/package/metadata.desktop +++ b/clients/aurorae/themes/plastik/package/metadata.desktop @@ -89,6 +89,7 @@ Name[x-test]=xxPlastikxx Name[zh_CN]=Plastik Name[zh_TW]=Plastik Comment=The classic theme known from KDE 3 +Comment[bs]=Klasična tema iz KDE 3 Comment[ca]=El tema clàssic conegut des del KDE 3 Comment[ca@valencia]=El tema clàssic conegut des del KDE 3 Comment[cs]=Klasický motiv známý z KDE 3 diff --git a/composite.cpp b/composite.cpp index 211e036b48..9cda6b061a 100644 --- a/composite.cpp +++ b/composite.cpp @@ -98,6 +98,7 @@ Compositor::Compositor(QObject* workspace) connect(&unredirectTimer, SIGNAL(timeout()), SLOT(delayedCheckUnredirect())); connect(&compositeResetTimer, SIGNAL(timeout()), SLOT(restart())); connect(workspace, SIGNAL(configChanged()), SLOT(slotConfigChanged())); + connect(options, SIGNAL(unredirectFullscreenChanged()), SLOT(delayedCheckUnredirect())); unredirectTimer.setSingleShot(true); compositeResetTimer.setSingleShot(true); nextPaintReference.invalidate(); // Initialize the timer @@ -693,7 +694,7 @@ void Compositor::checkUnredirect(bool force) void Compositor::delayedCheckUnredirect() { - if (!hasScene() || m_scene->overlayWindow()->window() == None || !options->isUnredirectFullscreen()) + if (!hasScene() || m_scene->overlayWindow()->window() == None || !(options->isUnredirectFullscreen() || sender() == options)) return; ToplevelList list; bool changed = forceUnredirectCheck; @@ -1047,7 +1048,8 @@ void Toplevel::addWorkspaceRepaint(const QRect& r2) bool Toplevel::updateUnredirectedState() { assert(compositing()); - bool should = shouldUnredirect() && !unredirectSuspend && !shape() && !hasAlpha() && opacity() == 1.0 && + bool should = options->isUnredirectFullscreen() && shouldUnredirect() && !unredirectSuspend && + !shape() && !hasAlpha() && opacity() == 1.0 && !static_cast(effects)->activeFullScreenEffect(); if (should == unredirect) return false; diff --git a/cursor.cpp b/cursor.cpp index 8ec8511e2e..5e35a209e7 100644 --- a/cursor.cpp +++ b/cursor.cpp @@ -166,7 +166,7 @@ X11Cursor::X11Cursor(QObject *parent) m_resetTimeStampTimer->setSingleShot(true); connect(m_resetTimeStampTimer, SIGNAL(timeout()), SLOT(resetTimeStamp())); // TODO: How often do we really need to poll? - m_mousePollingTimer->setInterval(100); + m_mousePollingTimer->setInterval(50); connect(m_mousePollingTimer, SIGNAL(timeout()), SLOT(mousePolled())); } diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 322c27d750..4a7f97a2e5 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -59,9 +59,9 @@ install( TARGETS kwin_update_settings_411 DESTINATION ${LIB_INSTALL_DIR}/kconf_u install( FILES fsp_workarounds_1.kwinrules DESTINATION ${DATA_INSTALL_DIR}/kwin/default_rules ) install( FILES pop.wav DESTINATION ${SOUND_INSTALL_DIR} ) -install( FILES kwin_fsp_workarounds_1.upd kwin_update_tabbox_settings.upd kwin_remove_effects.upd kwin_update_tabbox_qml_settings.upd kwin_remove_delay_focus.upd kwin_update_49.upd kwin_update_410.upd kwin_translate_activity_rule.upd +install( FILES kwin_fsp_workarounds_1.upd kwin_update_tabbox_settings.upd kwin_remove_effects.upd kwin_update_tabbox_qml_settings.upd kwin_remove_delay_focus.upd kwin_update_49.upd kwin_update_410.upd kwin_translate_activity_rule.upd kwin_translate_confrequest_rule.upd kwin_update_411.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) -install( PROGRAMS kwin_remove_delay_focus.sh kwin_translate_activity_rule.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) +install( PROGRAMS kwin_remove_delay_focus.sh kwin_translate_activity_rule.sh kwin_translate_confrequest_rule.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( FILES stripTitle.js DESTINATION ${DATA_INSTALL_DIR}/kwin ) diff --git a/data/kwin_translate_confrequest_rule.sh b/data/kwin_translate_confrequest_rule.sh new file mode 100755 index 0000000000..62587a4e93 --- /dev/null +++ b/data/kwin_translate_confrequest_rule.sh @@ -0,0 +1,14 @@ +#!/bin/sh +COUNT=`kreadconfig --file kwinrulesrc --group General --key count` +if [ -z "$COUNT" ]; then + exit 0 # nothing to do for us +fi + +# can you imaging how *much* faster sed is? +# it's however less reliable (installation, ini config, etc.) + +for i in `seq 1 $COUNT`; do + if [ "`kreadconfig --file kwinrulesrc --group $i --key ignoregeometryrule`" = "2" ]; then + kwriteconfig --file kwinrulesrc --group $i --key ignoregeometryrule "3" + fi +done \ No newline at end of file diff --git a/data/kwin_translate_confrequest_rule.upd b/data/kwin_translate_confrequest_rule.upd new file mode 100644 index 0000000000..edbd271109 --- /dev/null +++ b/data/kwin_translate_confrequest_rule.upd @@ -0,0 +1,2 @@ +Id=Kwin-4.11 +Script=kwin_translate_confrequest_rule.sh \ No newline at end of file diff --git a/deleted.cpp b/deleted.cpp index de26ae18e4..5bfc196989 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -41,6 +41,7 @@ Deleted::Deleted() , m_minimized(false) , m_modal(false) , m_paintRedirector(NULL) + , m_wasClient(false) { } @@ -81,6 +82,7 @@ void Deleted::copyToDeleted(Toplevel* c) cinfo->disable(); Client* client = dynamic_cast(c); if (client) { + m_wasClient = true; no_border = client->noBorder(); padding_left = client->paddingLeft(); padding_right = client->paddingRight(); diff --git a/deleted.h b/deleted.h index 69fb50e0dc..79b93ac06e 100644 --- a/deleted.h +++ b/deleted.h @@ -66,6 +66,9 @@ public: PaintRedirector *decorationPaintRedirector() { return m_paintRedirector; } + bool wasClient() const { + return m_wasClient; + } protected: virtual void debug(QDebug& stream) const; virtual bool shouldUnredirect() const; @@ -93,6 +96,7 @@ private: bool m_modal; ClientList m_mainClients; PaintRedirector *m_paintRedirector; + bool m_wasClient; }; inline void Deleted::refWindow() diff --git a/effects.cpp b/effects.cpp index 971c255d1e..224c5add5a 100644 --- a/effects.cpp +++ b/effects.cpp @@ -223,7 +223,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) dbus.registerObject(QStringLiteral("/Effects"), this); dbus.registerService(QStringLiteral("org.kde.kwin.Effects")); // init is important, otherwise causes crashes when quads are build before the first painting pass start - m_currentBuildQuadsIterator = m_activeEffects.end(); + m_currentBuildQuadsIterator = m_activeEffects.constEnd(); Workspace *ws = Workspace::self(); VirtualDesktopManager *vds = VirtualDesktopManager::self(); @@ -282,6 +282,7 @@ void EffectsHandlerImpl::setupClientConnections(Client* c) connect(c, SIGNAL(opacityChanged(KWin::Toplevel*,qreal)), this, SLOT(slotOpacityChanged(KWin::Toplevel*,qreal))); connect(c, SIGNAL(clientMinimized(KWin::Client*,bool)), this, SLOT(slotClientMinimized(KWin::Client*,bool))); connect(c, SIGNAL(clientUnminimized(KWin::Client*,bool)), this, SLOT(slotClientUnminimized(KWin::Client*,bool))); + connect(c, SIGNAL(modalChanged()), this, SLOT(slotClientModalityChanged())); connect(c, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), this, SLOT(slotGeometryShapeChanged(KWin::Toplevel*,QRect))); connect(c, SIGNAL(paddingChanged(KWin::Toplevel*,QRect)), this, SLOT(slotPaddingChanged(KWin::Toplevel*,QRect))); connect(c, SIGNAL(damaged(KWin::Toplevel*,QRect)), this, SLOT(slotWindowDamaged(KWin::Toplevel*,QRect))); @@ -304,6 +305,7 @@ void EffectsHandlerImpl::reconfigure() QFutureWatcher *watcher = new QFutureWatcher(this); connect(watcher, SIGNAL(finished()), this, SLOT(slotEffectsQueried())); watcher->setFuture(QtConcurrent::run(KServiceTypeTrader::self(), &KServiceTypeTrader::query, QStringLiteral("KWin/Effect"), QString())); + watcher->waitForFinished(); // TODO: remove once KConfigGroup is thread safe, bug #321576 } void EffectsHandlerImpl::slotEffectsQueried() @@ -356,7 +358,7 @@ void EffectsHandlerImpl::slotEffectsQueried() // the idea is that effects call this function again which calls the next one void EffectsHandlerImpl::prePaintScreen(ScreenPrePaintData& data, int time) { - if (m_currentPaintScreenIterator != m_activeEffects.end()) { + if (m_currentPaintScreenIterator != m_activeEffects.constEnd()) { (*m_currentPaintScreenIterator++)->prePaintScreen(data, time); --m_currentPaintScreenIterator; } @@ -365,7 +367,7 @@ void EffectsHandlerImpl::prePaintScreen(ScreenPrePaintData& data, int time) void EffectsHandlerImpl::paintScreen(int mask, QRegion region, ScreenPaintData& data) { - if (m_currentPaintScreenIterator != m_activeEffects.end()) { + if (m_currentPaintScreenIterator != m_activeEffects.constEnd()) { (*m_currentPaintScreenIterator++)->paintScreen(mask, region, data); --m_currentPaintScreenIterator; } else @@ -380,8 +382,8 @@ void EffectsHandlerImpl::paintDesktop(int desktop, int mask, QRegion region, Scr m_currentRenderedDesktop = desktop; m_desktopRendering = true; // save the paint screen iterator - QList::iterator savedIterator = m_currentPaintScreenIterator; - m_currentPaintScreenIterator = m_activeEffects.begin(); + EffectsIterator savedIterator = m_currentPaintScreenIterator; + m_currentPaintScreenIterator = m_activeEffects.constBegin(); effects->paintScreen(mask, region, data); // restore the saved iterator m_currentPaintScreenIterator = savedIterator; @@ -390,7 +392,7 @@ void EffectsHandlerImpl::paintDesktop(int desktop, int mask, QRegion region, Scr void EffectsHandlerImpl::postPaintScreen() { - if (m_currentPaintScreenIterator != m_activeEffects.end()) { + if (m_currentPaintScreenIterator != m_activeEffects.constEnd()) { (*m_currentPaintScreenIterator++)->postPaintScreen(); --m_currentPaintScreenIterator; } @@ -399,7 +401,7 @@ void EffectsHandlerImpl::postPaintScreen() void EffectsHandlerImpl::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) { - if (m_currentPaintWindowIterator != m_activeEffects.end()) { + if (m_currentPaintWindowIterator != m_activeEffects.constEnd()) { (*m_currentPaintWindowIterator++)->prePaintWindow(w, data, time); --m_currentPaintWindowIterator; } @@ -408,7 +410,7 @@ void EffectsHandlerImpl::prePaintWindow(EffectWindow* w, WindowPrePaintData& dat void EffectsHandlerImpl::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) { - if (m_currentPaintWindowIterator != m_activeEffects.end()) { + if (m_currentPaintWindowIterator != m_activeEffects.constEnd()) { (*m_currentPaintWindowIterator++)->paintWindow(w, mask, region, data); --m_currentPaintWindowIterator; } else @@ -417,7 +419,7 @@ void EffectsHandlerImpl::paintWindow(EffectWindow* w, int mask, QRegion region, void EffectsHandlerImpl::paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity) { - if (m_currentPaintEffectFrameIterator != m_activeEffects.end()) { + if (m_currentPaintEffectFrameIterator != m_activeEffects.constEnd()) { (*m_currentPaintEffectFrameIterator++)->paintEffectFrame(frame, region, opacity, frameOpacity); --m_currentPaintEffectFrameIterator; } else { @@ -428,7 +430,7 @@ void EffectsHandlerImpl::paintEffectFrame(EffectFrame* frame, QRegion region, do void EffectsHandlerImpl::postPaintWindow(EffectWindow* w) { - if (m_currentPaintWindowIterator != m_activeEffects.end()) { + if (m_currentPaintWindowIterator != m_activeEffects.constEnd()) { (*m_currentPaintWindowIterator++)->postPaintWindow(w); --m_currentPaintWindowIterator; } @@ -445,7 +447,7 @@ Effect *EffectsHandlerImpl::provides(Effect::Feature ef) void EffectsHandlerImpl::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) { - if (m_currentDrawWindowIterator != m_activeEffects.end()) { + if (m_currentDrawWindowIterator != m_activeEffects.constEnd()) { (*m_currentDrawWindowIterator++)->drawWindow(w, mask, region, data); --m_currentDrawWindowIterator; } else @@ -456,14 +458,14 @@ void EffectsHandlerImpl::buildQuads(EffectWindow* w, WindowQuadList& quadList) { static bool initIterator = true; if (initIterator) { - m_currentBuildQuadsIterator = m_activeEffects.begin(); + m_currentBuildQuadsIterator = m_activeEffects.constBegin(); initIterator = false; } - if (m_currentBuildQuadsIterator != m_activeEffects.end()) { + if (m_currentBuildQuadsIterator != m_activeEffects.constEnd()) { (*m_currentBuildQuadsIterator++)->buildQuads(w, quadList); --m_currentBuildQuadsIterator; } - if (m_currentBuildQuadsIterator == m_activeEffects.begin()) + if (m_currentBuildQuadsIterator == m_activeEffects.constBegin()) initIterator = true; } @@ -486,15 +488,16 @@ bool EffectsHandlerImpl::decorationSupportsBlurBehind() const void EffectsHandlerImpl::startPaint() { m_activeEffects.clear(); - for(QVector< KWin::EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it) { + m_activeEffects.reserve(loaded_effects.count()); + for(QVector< KWin::EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if (it->second->isActive()) { m_activeEffects << it->second; } } - m_currentDrawWindowIterator = m_activeEffects.begin(); - m_currentPaintWindowIterator = m_activeEffects.begin(); - m_currentPaintScreenIterator = m_activeEffects.begin(); - m_currentPaintEffectFrameIterator = m_activeEffects.begin(); + m_currentDrawWindowIterator = m_activeEffects.constBegin(); + m_currentPaintWindowIterator = m_activeEffects.constBegin(); + m_currentPaintScreenIterator = m_activeEffects.constBegin(); + m_currentPaintEffectFrameIterator = m_activeEffects.constBegin(); } void EffectsHandlerImpl::slotClientMaximized(KWin::Client *c, KDecorationDefines::MaximizeMode maxMode) @@ -554,9 +557,9 @@ void EffectsHandlerImpl::slotClientAdded(Client *c) } void EffectsHandlerImpl::slotUnmanagedAdded(Unmanaged *u) -{ // regardless, unmanaged windows are -yet?- not synced anyway - setupUnmanagedConnections(u); - emit windowAdded(u->effectWindow()); +{ + // it's never initially ready but has synthetic 50ms delay + connect(u, SIGNAL(windowShown(KWin::Toplevel*)), SLOT(slotUnmanagedShown(KWin::Toplevel*))); } void EffectsHandlerImpl::slotClientShown(KWin::Toplevel *t) @@ -568,6 +571,14 @@ void EffectsHandlerImpl::slotClientShown(KWin::Toplevel *t) emit windowAdded(c->effectWindow()); } +void EffectsHandlerImpl::slotUnmanagedShown(KWin::Toplevel *t) +{ // regardless, unmanaged windows are -yet?- not synced anyway + Q_ASSERT(dynamic_cast(t)); + Unmanaged *u = static_cast(t); + setupUnmanagedConnections(u); + emit windowAdded(u->effectWindow()); +} + void EffectsHandlerImpl::slotDeletedRemoved(KWin::Deleted *d) { emit windowDeleted(d->effectWindow()); @@ -601,6 +612,11 @@ void EffectsHandlerImpl::slotClientUnminimized(Client* c, bool animate) } } +void EffectsHandlerImpl::slotClientModalityChanged() +{ + emit windowModalityChanged(static_cast(sender())->effectWindow()); +} + void EffectsHandlerImpl::slotCurrentTabAboutToChange(EffectWindow *from, EffectWindow *to) { emit currentTabAboutToChange(from, to); @@ -737,7 +753,7 @@ void* EffectsHandlerImpl::getProxy(QString name) // All effects start with "kwin4_effect_", prepend it to the name name.prepend(QStringLiteral("kwin4_effect_")); - for (QVector< EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it) + for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) if ((*it).first == name) return (*it).second->proxy(); @@ -1030,8 +1046,10 @@ EffectWindowList EffectsHandlerImpl::stackingOrder() const { ToplevelList list = Workspace::self()->xStackingOrder(); EffectWindowList ret; - foreach (Toplevel *w, list) - ret.append(effectWindow(w)); + foreach (Toplevel *t, list) { + if (EffectWindow *w = effectWindow(t)) + ret.append(w); + } return ret; } @@ -1489,7 +1507,7 @@ void EffectsHandlerImpl::unloadEffect(const QString& name) void EffectsHandlerImpl::reconfigureEffect(const QString& name) { - for (QVector< EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it) + for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) if ((*it).first == name) { (*it).second->reconfigure(Effect::ReconfigureAll); return; @@ -1508,7 +1526,7 @@ bool EffectsHandlerImpl::isEffectLoaded(const QString& name) const void EffectsHandlerImpl::reloadEffect(Effect *effect) { QString effectName; - for (QVector< EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it) { + for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if ((*it).second == effect) { effectName = (*it).first; break; @@ -1529,6 +1547,7 @@ void EffectsHandlerImpl::effectsChanged() // kDebug(1212) << effect.first; loaded_effects.append(effect); } + m_activeEffects.reserve(loaded_effects.count()); } QStringList EffectsHandlerImpl::activeEffects() const diff --git a/effects.h b/effects.h index 01c45db2c0..34c133cf86 100644 --- a/effects.h +++ b/effects.h @@ -222,6 +222,7 @@ protected Q_SLOTS: void slotClientAdded(KWin::Client *c); void slotClientShown(KWin::Toplevel*); void slotUnmanagedAdded(KWin::Unmanaged *u); + void slotUnmanagedShown(KWin::Toplevel*); void slotWindowClosed(KWin::Toplevel *c); void slotClientActivated(KWin::Client *c); void slotDeletedRemoved(KWin::Deleted *d); @@ -232,6 +233,7 @@ protected Q_SLOTS: void slotOpacityChanged(KWin::Toplevel *t, qreal oldOpacity); void slotClientMinimized(KWin::Client *c, bool animate); void slotClientUnminimized(KWin::Client *c, bool animate); + void slotClientModalityChanged(); void slotGeometryShapeChanged(KWin::Toplevel *t, const QRect &old); void slotPaddingChanged(KWin::Toplevel *t, const QRect &old); void slotWindowDamaged(KWin::Toplevel *t, const QRect& r); @@ -256,12 +258,14 @@ private Q_SLOTS: void slotEffectsQueried(); private: - QList< Effect* > m_activeEffects; - QList< Effect* >::iterator m_currentDrawWindowIterator; - QList< Effect* >::iterator m_currentPaintWindowIterator; - QList< Effect* >::iterator m_currentPaintEffectFrameIterator; - QList< Effect* >::iterator m_currentPaintScreenIterator; - QList< Effect* >::iterator m_currentBuildQuadsIterator; + typedef QVector< Effect*> EffectsList; + typedef EffectsList::const_iterator EffectsIterator; + EffectsList m_activeEffects; + EffectsIterator m_currentDrawWindowIterator; + EffectsIterator m_currentPaintWindowIterator; + EffectsIterator m_currentPaintEffectFrameIterator; + EffectsIterator m_currentPaintScreenIterator; + EffectsIterator m_currentBuildQuadsIterator; typedef QHash< QByteArray, QList< Effect*> > PropertyEffectMap; PropertyEffectMap m_propertiesForEffects; QHash m_managedProperties; diff --git a/effects/coverswitch/coverswitch.desktop b/effects/coverswitch/coverswitch.desktop index ca01e16781..4d7a44db2e 100644 --- a/effects/coverswitch/coverswitch.desktop +++ b/effects/coverswitch/coverswitch.desktop @@ -20,7 +20,7 @@ Name[fi]=Levykansivaihtaja Name[fr]=Défilement circulaire Name[fy]=Foarplaat wiksel Name[ga]=Cover Switch -Name[gl]=Mudanza en capas +Name[gl]=Cambio en capas Name[gu]=ફેરફાર ઢાંકો Name[he]=מחליף דפדוף בין תקליטים Name[hi]=कवर स्विच diff --git a/effects/coverswitch/coverswitch_config.desktop b/effects/coverswitch/coverswitch_config.desktop index 80ed9c62ec..c6bb6f904d 100644 --- a/effects/coverswitch/coverswitch_config.desktop +++ b/effects/coverswitch/coverswitch_config.desktop @@ -27,7 +27,7 @@ Name[fi]=Levykansivaihtaja Name[fr]=Défilement circulaire Name[fy]=Foarplaat wiksel Name[ga]=Cover Switch -Name[gl]=Mudanza en capas +Name[gl]=Cambio en capas Name[gu]=ફેરફાર ઢાંકો Name[he]=מחליף דפדוף בין תקליטים Name[hi]=कवर स्विच diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index 46e7f67ee2..057bb33da9 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -30,6 +30,7 @@ along with this program. If not, see . #include #include +#include #include #include #include @@ -52,7 +53,6 @@ KWIN_EFFECT_SUPPORTED(cube, CubeEffect::supported()) CubeEffect::CubeEffect() : activated(false) - , mousePolling(false) , cube_painting(false) , keyboard_grab(false) , schedule_close(false) @@ -122,8 +122,6 @@ CubeEffect::CubeEffect() connect(effects, SIGNAL(tabBoxAdded(int)), this, SLOT(slotTabBoxAdded(int))); connect(effects, SIGNAL(tabBoxClosed()), this, SLOT(slotTabBoxClosed())); connect(effects, SIGNAL(tabBoxUpdated()), this, SLOT(slotTabBoxUpdated())); - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); reconfigure(ReconfigureAll); } @@ -1900,10 +1898,6 @@ void CubeEffect::setActive(bool active) connect(watcher, SIGNAL(finished()), SLOT(slotWallPaperLoaded())); watcher->setFuture(QtConcurrent::run(this, &CubeEffect::loadWallPaper, wallpaperPath)); } - if (!mousePolling) { - effects->startMousePolling(); - mousePolling = true; - } activated = true; activeScreen = effects->activeScreen(); keyboard_grab = effects->grabKeyboard(this); @@ -1935,18 +1929,13 @@ void CubeEffect::setActive(bool active) m_rotationMatrix.setToIdentity(); effects->addRepaintFull(); } else { - if (mousePolling) { - effects->stopMousePolling(); - mousePolling = false; - } schedule_close = true; // we have to add a repaint, to start the deactivating effects->addRepaintFull(); } } -void CubeEffect::slotMouseChanged(const QPoint& pos, const QPoint& oldpos, Qt::MouseButtons buttons, - Qt::MouseButtons oldbuttons, Qt::KeyboardModifiers, Qt::KeyboardModifiers) +void CubeEffect::windowInputMouseEvent(QEvent* e) { if (!activated) return; @@ -1954,8 +1943,17 @@ void CubeEffect::slotMouseChanged(const QPoint& pos, const QPoint& oldpos, Qt::M return; if (stop) return; - QRect rect = effects->clientArea(FullArea, activeScreen, effects->currentDesktop()); - if (buttons.testFlag(Qt::LeftButton)) { + + QMouseEvent *mouse = dynamic_cast< QMouseEvent* >(e); + if (!mouse) + return; + + static QPoint oldpos; + static QElapsedTimer dblClckTime; + static int dblClckCounter(0); + if (mouse->type() == QEvent::MouseMove && mouse->buttons().testFlag(Qt::LeftButton)) { + const QPoint pos = mouse->pos(); + QRect rect = effects->clientArea(FullArea, activeScreen, effects->currentDesktop()); bool repaint = false; // vertical movement only if there is not a rotation if (!verticalRotating) { @@ -1991,43 +1989,43 @@ void CubeEffect::slotMouseChanged(const QPoint& pos, const QPoint& oldpos, Qt::M rotateCube(); effects->addRepaintFull(); } + oldpos = pos; } - if (!oldbuttons.testFlag(Qt::LeftButton) && buttons.testFlag(Qt::LeftButton)) { - effects->defineCursor(Qt::ClosedHandCursor); - } - if (oldbuttons.testFlag(Qt::LeftButton) && !buttons.testFlag(Qt::LeftButton)) { - effects->defineCursor(Qt::OpenHandCursor); - if (closeOnMouseRelease) - setActive(false); - } - if (oldbuttons.testFlag(Qt::RightButton) && !buttons.testFlag(Qt::RightButton)) { - // end effect on right mouse button - setActive(false); - } -} -void CubeEffect::windowInputMouseEvent(QEvent* e) -{ - QMouseEvent *mouse = dynamic_cast< QMouseEvent* >(e); - if (mouse && mouse->type() == QEvent::MouseButtonRelease) { - if (mouse->button() == Qt::XButton1) { - if (!rotating && !start) { - rotating = true; - if (invertMouse) - rotationDirection = Right; - else - rotationDirection = Left; - } else { - if (rotations.count() < effects->numberOfDesktops()) { - if (invertMouse) - rotations.enqueue(Right); - else - rotations.enqueue(Left); - } + else if (mouse->type() == QEvent::MouseButtonPress && mouse->button() == Qt::LeftButton) { + oldpos = mouse->pos(); + if (dblClckTime.elapsed() > QApplication::doubleClickInterval()) + dblClckCounter = 0; + if (!dblClckCounter) + dblClckTime.start(); + } + + else if (mouse->type() == QEvent::MouseButtonRelease) { + effects->defineCursor(Qt::OpenHandCursor); + if (mouse->button() == Qt::LeftButton && ++dblClckCounter == 2) { + dblClckCounter = 0; + if (dblClckTime.elapsed() < QApplication::doubleClickInterval()) { + setActive(false); + return; } - effects->addRepaintFull(); } - if (mouse->button() == Qt::XButton2) { + else if (mouse->button() == Qt::XButton1) { + if (!rotating && !start) { + rotating = true; + if (invertMouse) + rotationDirection = Right; + else + rotationDirection = Left; + } else { + if (rotations.count() < effects->numberOfDesktops()) { + if (invertMouse) + rotations.enqueue(Right); + else + rotations.enqueue(Left); + } + } + effects->addRepaintFull(); + } else if (mouse->button() == Qt::XButton2) { if (!rotating && !start) { rotating = true; if (invertMouse) @@ -2043,6 +2041,8 @@ void CubeEffect::windowInputMouseEvent(QEvent* e) } } effects->addRepaintFull(); + } else if (mouse->button() == Qt::RightButton || (mouse->button() == Qt::LeftButton && closeOnMouseRelease)) { + setActive(false); } } } diff --git a/effects/cube/cube.h b/effects/cube/cube.h index f2e482a653..108bf1b93e 100644 --- a/effects/cube/cube.h +++ b/effects/cube/cube.h @@ -137,8 +137,6 @@ private Q_SLOTS: void slotTabBoxAdded(int mode); void slotTabBoxUpdated(); void slotTabBoxClosed(); - void slotMouseChanged(const QPoint& pos, const QPoint& oldpos, Qt::MouseButtons buttons, - Qt::MouseButtons oldbuttons, Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers); void slotCubeCapLoaded(); void slotWallPaperLoaded(); private: @@ -171,7 +169,6 @@ private: QImage loadCubeCap(const QString &capPath); QImage loadWallPaper(const QString &file); bool activated; - bool mousePolling; bool cube_painting; bool keyboard_grab; bool schedule_close; diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index 04a4d12f5e..2fe3b6cecf 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -857,8 +857,6 @@ int DesktopGridEffect::posToDesktop(const QPoint& pos) const double scaledY = (pos.y() - scaledOffset[screen].y() + double(border) / 2.0) / (scaledSize[screen].height() + border); int gx = qBound(0, int(scaledX), gridSize.width() - 1); // Zero-based int gy = qBound(0, int(scaledY), gridSize.height() - 1); - scaledX -= gx; - scaledY -= gy; if (orientation == Qt::Horizontal) return gy * gridSize.width() + gx + 1; return gx * gridSize.height() + gy + 1; diff --git a/effects/desktopgrid/desktopgrid.desktop b/effects/desktopgrid/desktopgrid.desktop index e4cb535d63..15afcedea0 100644 --- a/effects/desktopgrid/desktopgrid.desktop +++ b/effects/desktopgrid/desktopgrid.desktop @@ -129,7 +129,7 @@ Comment[ro]=Îndepărtează astfel încît toate birourile sînt afișate alătu Comment[ru]=Показать все рабочие столы на одном экране Comment[si]=සියළු වැඩතල ජාලයක පැත්තෙන් පැත්තට පෙනීම සඳහා විශාලනය අඩු කරන්න Comment[sk]=Oddiali všetky plochy a zobrazí ich vedľa seba v mriežke -Comment[sl]=Oddalji prikaz, tako da so vsa namizja prikazana eno ob drugem v mreži +Comment[sl]=Oddalji pogled, tako da so vsa namizja prikazana eno ob drugem v mreži Comment[sr]=Умањите тако да се све површи поређају једна до друге у мрежи Comment[sr@ijekavian]=Умањите тако да се све површи поређају једна до друге у мрежи Comment[sr@ijekavianlatin]=Umanjite tako da se sve površi poređaju jedna do druge u mreži diff --git a/effects/desktopgrid/desktopgrid_config.cpp b/effects/desktopgrid/desktopgrid_config.cpp index e0afa053fc..c582fc52af 100644 --- a/effects/desktopgrid/desktopgrid_config.cpp +++ b/effects/desktopgrid/desktopgrid_config.cpp @@ -81,6 +81,7 @@ DesktopGridEffectConfig::DesktopGridEffectConfig(QWidget* parent, const QVariant addConfig(DesktopGridConfig::self(), m_ui); connect(m_ui->kcfg_LayoutMode, SIGNAL(currentIndexChanged(int)), this, SLOT(layoutSelectionChanged())); connect(m_ui->desktopNameAlignmentCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); + connect(m_ui->shortcutEditor, SIGNAL(keyChange()), this, SLOT(changed())); load(); layoutSelectionChanged(); diff --git a/effects/dialogparent/package/contents/code/main.js b/effects/dialogparent/package/contents/code/main.js index e4c2f70a77..52ee202631 100644 --- a/effects/dialogparent/package/contents/code/main.js +++ b/effects/dialogparent/package/contents/code/main.js @@ -27,6 +27,10 @@ var dialogParentEffect = { if (window === null || window.modal === false) { return; } + dialogParentEffect.dialogGotModality(window) + }, + dialogGotModality: function (window) { + "use strict"; mainWindows = window.mainWindows(); for (i = 0; i < mainWindows.length; i += 1) { w = mainWindows[i]; @@ -60,6 +64,10 @@ var dialogParentEffect = { if (window.modal === false) { return; } + dialogParentEffect.dialogLostModality(window); + }, + dialogLostModality: function (window) { + "use strict"; mainWindows = window.mainWindows(); for (i = 0; i < mainWindows.length; i += 1) { w = mainWindows[i]; @@ -96,10 +104,17 @@ var dialogParentEffect = { windows = effects.stackingOrder; for (i = 0; i < windows.length; i += 1) { window = windows[i]; - dialogParentEffect.cancelAnimation(window); + dialogParentEffect.cancelAnimation(window); dialogParentEffect.restartAnimation(window); } }, + modalDialogChanged: function(dialog) { + "use strict"; + if (dialog.modal === false) + dialogParentEffect.dialogLostModality(dialog); + else if (dialog.modal === true) + dialogParentEffect.dialogGotModality(dialog); + }, restartAnimation: function (window) { "use strict"; if (window === null || window.findModal() === null) { @@ -110,10 +125,11 @@ var dialogParentEffect = { init: function () { "use strict"; var i, windows; - effects.windowActivated.connect(dialogParentEffect.windowAdded); + effects.windowAdded.connect(dialogParentEffect.windowAdded); effects.windowClosed.connect(dialogParentEffect.windowClosed); effects.windowMinimized.connect(dialogParentEffect.cancelAnimation); effects.windowUnminimized.connect(dialogParentEffect.restartAnimation); + effects.windowModalityChanged.connect(dialogParentEffect.modalDialogChanged) effects['desktopChanged(int,int)'].connect(dialogParentEffect.desktopChanged); // start animation diff --git a/effects/flipswitch/flipswitch.desktop b/effects/flipswitch/flipswitch.desktop index d863ccc02e..ace583bbf7 100644 --- a/effects/flipswitch/flipswitch.desktop +++ b/effects/flipswitch/flipswitch.desktop @@ -19,7 +19,7 @@ Name[fi]=Kääntövaihtaja Name[fr]=Empilement en perspective Name[fy]=Flip wiksel Name[ga]=Flip Switch -Name[gl]=Mudanza en fila +Name[gl]=Cambio en fila Name[gu]=ફ્લિપ સ્વિચ Name[he]=מחליף ערמה Name[hi]=स्विच बदलें diff --git a/effects/flipswitch/flipswitch_config.desktop b/effects/flipswitch/flipswitch_config.desktop index b6835b326e..8238ab4d8f 100644 --- a/effects/flipswitch/flipswitch_config.desktop +++ b/effects/flipswitch/flipswitch_config.desktop @@ -26,7 +26,7 @@ Name[fi]=Kääntövaihtaja Name[fr]=Empilement en perspective Name[fy]=Flip wiksel Name[ga]=Flip Switch -Name[gl]=Mudanza en fila +Name[gl]=Cambio en fila Name[gu]=ફ્લિપ સ્વિચ Name[he]=מחליף ערמה Name[hi]=स्विच बदलें diff --git a/effects/invert/data/1.10/invert.frag b/effects/invert/data/1.10/invert.frag index a9e1201460..9fe602b654 100644 --- a/effects/invert/data/1.10/invert.frag +++ b/effects/invert/data/1.10/invert.frag @@ -14,8 +14,8 @@ void main() tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation ); } - tex *= modulation; tex.rgb = vec3(1.0) - tex.rgb; + tex *= modulation; tex.rgb *= tex.a; gl_FragColor = tex; diff --git a/effects/invert/data/1.40/invert.frag b/effects/invert/data/1.40/invert.frag index 0b6d21951e..6dee1e60ad 100644 --- a/effects/invert/data/1.40/invert.frag +++ b/effects/invert/data/1.40/invert.frag @@ -17,8 +17,8 @@ void main() tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation ); } - tex *= modulation; tex.rgb = vec3(1.0) - tex.rgb; + tex *= modulation; tex.rgb *= tex.a; fragColor = tex; diff --git a/effects/kscreen/kscreen.desktop b/effects/kscreen/kscreen.desktop index 8ef64e3d65..f5127baafe 100644 --- a/effects/kscreen/kscreen.desktop +++ b/effects/kscreen/kscreen.desktop @@ -1,13 +1,20 @@ [Desktop Entry] Name=Kscreen +Name[bs]=KScreen Name[ca]=Kscreen Name[cs]=Kscreen +Name[da]=KScreen Name[de]=Kscreen +Name[el]=Kscreen Name[es]=Kscreen Name[fi]=KScreen +Name[fr]=KScreen Name[gl]=KScreen +Name[hu]=Kscreen Name[ia]=Kscreen +Name[it]=Kscreen Name[kk]=Kscreen +Name[ko]=Kscreen Name[nl]=Kscreen Name[pa]=ਕੇਸਕਰੀਨ Name[pt]=Kscreen @@ -20,20 +27,27 @@ Name[sr@ijekavian]=К‑екран Name[sr@ijekavianlatin]=K‑ekran Name[sr@latin]=K‑ekran Name[sv]=Kskärm +Name[tr]=Kscreen Name[uk]=Kscreen Name[x-test]=xxKscreenxx Name[zh_CN]=Kscreen Name[zh_TW]=Kscreen Icon=preferences-system-windows-effect-kscreen Comment=Helper Effect for KScreen +Comment[bs]=Pomoćni efekat za KScreen Comment[ca]=Efecte auxiliar pel KScreen Comment[cs]=Pomocný efekt pro KScreen +Comment[da]=Hjælpeeffekt til KScreen Comment[de]=Hilfseffekt für KScreen Comment[es]=Efecto auxiliar para KScreen Comment[fi]=Avustajatehoste KScreenille +Comment[fr]=Effet d'assistance pour KScreen Comment[gl]=Efecto auxiliar para KScreen. +Comment[hu]=Segédeffektus a KScreenhez Comment[ia]=Effecto de adjutante pro KScreen +Comment[it]=Effetto di assistenza per KScreen Comment[kk]=KScreen-нің көмек эффекті +Comment[ko]=KScreen 도우미 효과 Comment[nl]=Effect van hulp voor KScreen Comment[pa]=ਕੇਸਕਰੀਨ ਲਈ ਮੱਦਦ ਪ੍ਰਭਾਵ Comment[pt]=Efeito auxiliar do KScreen @@ -46,6 +60,7 @@ Comment[sr@ijekavian]=Помоћни ефекат за К‑екран Comment[sr@ijekavianlatin]=Pomoćni efekat za K‑ekran Comment[sr@latin]=Pomoćni efekat za K‑ekran Comment[sv]=Hjälpeffekt för Kskärm +Comment[tr]=KScreen için Yardımcı Efekt Comment[uk]=Допоміжний ефект KScreen Comment[x-test]=xxHelper Effect for KScreenxx Comment[zh_CN]=KScreen 的帮助效果 diff --git a/effects/logout/CMakeLists.txt b/effects/logout/CMakeLists.txt index c3316bc21c..aa37fd7b1d 100644 --- a/effects/logout/CMakeLists.txt +++ b/effects/logout/CMakeLists.txt @@ -15,6 +15,13 @@ install( FILES # Data files install( FILES - logout/data/vignetting.frag - logout/data/logout-blur.frag - DESTINATION ${DATA_INSTALL_DIR}/kwin ) + logout/data/1.10/vignetting.frag + logout/data/1.10/logout-blur.frag + DESTINATION ${DATA_INSTALL_DIR}/kwin/shaders/1.10 +) + +install( FILES + logout/data/1.40/vignetting.frag + logout/data/1.40/logout-blur.frag + DESTINATION ${DATA_INSTALL_DIR}/kwin/shaders/1.40 +) diff --git a/effects/logout/data/logout-blur.frag b/effects/logout/data/1.10/logout-blur.frag similarity index 100% rename from effects/logout/data/logout-blur.frag rename to effects/logout/data/1.10/logout-blur.frag diff --git a/effects/logout/data/vignetting.frag b/effects/logout/data/1.10/vignetting.frag similarity index 100% rename from effects/logout/data/vignetting.frag rename to effects/logout/data/1.10/vignetting.frag diff --git a/effects/logout/data/logout-blur-140.frag b/effects/logout/data/1.40/logout-blur.frag similarity index 100% rename from effects/logout/data/logout-blur-140.frag rename to effects/logout/data/1.40/logout-blur.frag diff --git a/effects/logout/data/vignetting-140.frag b/effects/logout/data/1.40/vignetting.frag similarity index 100% rename from effects/logout/data/vignetting-140.frag rename to effects/logout/data/1.40/vignetting.frag diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index f1bf3bc7b4..4eb80781e2 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -50,6 +50,7 @@ LogoutEffect::LogoutEffect() , ignoredWindows() , m_vignettingShader(NULL) , m_blurShader(NULL) + , m_shadersDir(QStringLiteral("kwin/shaders/1.10/")) { // Persistent effect logoutAtom = XInternAtom(display(), "_KDE_LOGGING_OUT", False); @@ -71,6 +72,14 @@ LogoutEffect::LogoutEffect() connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); + +#ifdef KWIN_HAVE_OPENGLES + const qint64 coreVersionNumber = kVersionNumber(3, 0); +#else + const qint64 coreVersionNumber = kVersionNumber(1, 40); +#endif + if (GLPlatform::instance()->glslVersion() >= coreVersionNumber) + m_shadersDir = QStringLiteral("kwin/shaders/1.40/"); } LogoutEffect::~LogoutEffect() @@ -296,10 +305,8 @@ void LogoutEffect::renderVignetting() return; } if (!m_vignettingShader) { - QString shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ? - QStringLiteral("kwin/vignetting-140.frag") : QStringLiteral("kwin/vignetting.frag"); m_vignettingShader = ShaderManager::instance()->loadFragmentShader(KWin::ShaderManager::ColorShader, - KGlobal::dirs()->findResource("data", shader)); + KGlobal::dirs()->findResource("data", m_shadersDir + QStringLiteral("vignetting.frag"))); if (!m_vignettingShader->isValid()) { kDebug(1212) << "Vignetting Shader failed to load"; return; @@ -378,10 +385,8 @@ void LogoutEffect::renderBlurTexture() return; } if (!m_blurShader) { - QString shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ? - QStringLiteral("kwin/logout-blur-140.frag") : QStringLiteral("kwin/logout-blur.frag"); m_blurShader = ShaderManager::instance()->loadFragmentShader(KWin::ShaderManager::SimpleShader, - KGlobal::dirs()->findResource("data", shader)); + KGlobal::dirs()->findResource("data", m_shadersDir + QStringLiteral("logout-blur.frag"))); if (!m_blurShader->isValid()) { kDebug(1212) << "Logout blur shader failed to load"; } diff --git a/effects/logout/logout.desktop b/effects/logout/logout.desktop index f4620097b3..28df6fa625 100644 --- a/effects/logout/logout.desktop +++ b/effects/logout/logout.desktop @@ -76,7 +76,7 @@ Name[te]=లాగ్అవుట్ Name[tg]=Баромадан Name[th]=ลงบันทึกออกจากระบบ Name[tr]=Çıkış -Name[ug]=تىزىمدىن چىىش +Name[ug]=تىزىمدىن چىقىش Name[uk]=Вихід Name[uz]=Chiqish Name[uz@cyrillic]=Чиқиш diff --git a/effects/logout/logout.h b/effects/logout/logout.h index 18fe279232..dee53bc992 100644 --- a/effects/logout/logout.h +++ b/effects/logout/logout.h @@ -82,6 +82,7 @@ private: QHash< EffectWindow*, double > windowsOpacities; GLShader *m_vignettingShader; GLShader *m_blurShader; + QString m_shadersDir; }; } // namespace diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index 0326c8f0f3..934242b780 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -258,7 +258,7 @@ void MagnifierEffect::zoomIn() polling = true; effects->startMousePolling(); } - if (!m_texture) { + if (effects->isOpenGLCompositing() && !m_texture) { m_texture = new GLTexture(magnifier_size.width(), magnifier_size.height()); m_texture->setYInverted(false); m_fbo = new GLRenderTarget(*m_texture); @@ -269,7 +269,7 @@ void MagnifierEffect::zoomIn() void MagnifierEffect::zoomOut() { target_zoom /= 1.2; - if (target_zoom < 1) { + if (target_zoom <= 1) { target_zoom = 1; if (polling) { polling = false; @@ -296,7 +296,7 @@ void MagnifierEffect::toggle() polling = true; effects->startMousePolling(); } - if (!m_texture) { + if (effects->isOpenGLCompositing() && !m_texture) { m_texture = new GLTexture(magnifier_size.width(), magnifier_size.height()); m_texture->setYInverted(false); m_fbo = new GLRenderTarget(*m_texture); diff --git a/effects/magnifier/magnifier.desktop b/effects/magnifier/magnifier.desktop index 9871a331cc..7624e8bbec 100644 --- a/effects/magnifier/magnifier.desktop +++ b/effects/magnifier/magnifier.desktop @@ -74,7 +74,7 @@ Name[te]=మాగ్నిఫైర్ Name[tg]=Увеличитель Name[th]=แว่นขยาย Name[tr]=Büyüteç -Name[ug]=لوپا ئەينەك +Name[ug]=چوڭايتقۇچ Name[uk]=Лупа Name[uz]=Kattalashtiruvchi Name[uz@cyrillic]=Катталаштирувчи diff --git a/effects/magnifier/magnifier_config.desktop b/effects/magnifier/magnifier_config.desktop index cc1517079e..e30a3c6258 100644 --- a/effects/magnifier/magnifier_config.desktop +++ b/effects/magnifier/magnifier_config.desktop @@ -81,7 +81,7 @@ Name[te]=మాగ్నిఫైర్ Name[tg]=Увеличитель Name[th]=แว่นขยาย Name[tr]=Büyüteç -Name[ug]=لوپا ئەينەك +Name[ug]=چوڭايتقۇچ Name[uk]=Лупа Name[uz]=Kattalashtiruvchi Name[uz@cyrillic]=Катталаштирувчи diff --git a/effects/maximize/package/metadata.desktop b/effects/maximize/package/metadata.desktop index 8a23249232..e74d6c0f12 100644 --- a/effects/maximize/package/metadata.desktop +++ b/effects/maximize/package/metadata.desktop @@ -1,5 +1,6 @@ [Desktop Entry] Comment=Animation for a window going to maximize/restore from maximize +Comment[bs]=Animacija za prozor koji ide u maksimiziranje/vraćanje iz maksimiziranja Comment[ca]=Animació per una finestra que es maximitza/restaura des de maximització Comment[ca@valencia]=Animació per una finestra que es maximitza/restaura des de maximització Comment[da]=Animation til et vindue der er ved at maksimere/gendanne fra maksimering @@ -39,6 +40,7 @@ Comment[zh_TW]=視窗最大化/回復時的動畫 Encoding=UTF-8 Icon=preferences-system-windows-effect-maximize Name=Maximize +Name[bs]=Maksimiziraj Name[ca]=Maximitza Name[ca@valencia]=Maximitza Name[cs]=Maximalizovat @@ -76,6 +78,7 @@ Name[sr@ijekavianlatin]=Maksimizovanje Name[sr@latin]=Maksimizovanje Name[sv]=Maximera Name[tr]=Ekranı Kapla +Name[ug]=چوڭايت Name[uk]=Максимізація Name[x-test]=xxMaximizexx Name[zh_CN]=最大化效果 diff --git a/effects/mouseclick/mouseclick.desktop b/effects/mouseclick/mouseclick.desktop index 517d56c3b6..cce2fb0952 100644 --- a/effects/mouseclick/mouseclick.desktop +++ b/effects/mouseclick/mouseclick.desktop @@ -1,5 +1,6 @@ [Desktop Entry] Name=Mouse Click Animation +Name[bs]=Animacija klika mišem Name[ca]=Animació de clic de ratolí Name[ca@valencia]=Animació de clic de ratolí Name[cs]=Animace kliknutí myši @@ -43,6 +44,7 @@ Name[zh_TW]=滑鼠點擊動畫 Icon=preferences-system-windows-effect-mouseclick Comment=Creates an animation whenever a mouse button is clicked. This is useful for screenrecordings/presentations. +Comment[bs]=Kreira animaciju kada se god protosne dugme miša. To je korisno zasnimanje ekrana/prezentacije. Comment[ca]=Crea una animació quan es fa clic amb un botó del ratolí. Això és útil per enregistrar la pantalla o en presentacions. Comment[ca@valencia]=Crea una animació quan es fa clic amb un botó del ratolí. Això és útil per enregistrar la pantalla o en presentacions. Comment[da]=Opretter en animation når der klikkes på en museknap. Dette er nyttigt til skærmoptagelser/præsentationer. @@ -57,7 +59,7 @@ Comment[hu]=Animációt hoz létre, amikor az egérgombbal kattintanak. Ez haszn Comment[ia]=Crea un animation quando un button de mus es pressate. Isto es util pro registrationes de schermo/presentationes Comment[it]=Crea un'animazione ogni volta che viene premuto un pulsante del mouse. Utile per registrazioni dello schermo o presentazioni. Comment[kk]=Тышқанның батырмасын түрткенде анимацияны жасайды.Экраннан демонстацияны түсіргнде/презентацияны жасағанда ыңғайлы. -Comment[ko]=마우스 단추를 눌렀을 때 애니메이션을 표시합니다. 화면 녹화/프리젠테이션에서 유용합니다. +Comment[ko]=마우스 단추를 눌렀을 때 애니메이션을 표시합니다. 화면 녹화/프레젠테이션에서 유용합니다. Comment[lt]=Kuria animaciją kai pelės mygtukas paspaudžiamas. Tai naudojama ekrano įrašymams / pristatymams. Comment[mr]=जेव्हा माऊस बटन क्लिक केले जाईल तेव्हा ऍनीमेशन करा. स्क्रीन रेकोर्डींग व प्रेझेंटेशनच्या वेळी हे उपयोगी आहे. Comment[nb]=Lager en animasjon hver gang en museknapp trykkes. Dette er nyttig for skjermopptak/presentasjoner. diff --git a/effects/mouseclick/mouseclick_config.desktop b/effects/mouseclick/mouseclick_config.desktop index 3515d2e4c1..6a482daaa0 100644 --- a/effects/mouseclick/mouseclick_config.desktop +++ b/effects/mouseclick/mouseclick_config.desktop @@ -7,6 +7,7 @@ X-KDE-ParentComponents=kwin4_effect_mouseclick X-KDE-PluginKeyword=mouseclick Name=Mouse Click Animation +Name[bs]=Animacija klika mišem Name[ca]=Animació de clic de ratolí Name[ca@valencia]=Animació de clic de ratolí Name[cs]=Animace kliknutí myši diff --git a/effects/presentwindows/main.qml b/effects/presentwindows/main.qml index 83af6c07c8..568df56fbc 100644 --- a/effects/presentwindows/main.qml +++ b/effects/presentwindows/main.qml @@ -26,7 +26,6 @@ Item { Plasma.Button { id: closeButton objectName: "closeButton" - enabled: armed iconSource: "window-close" anchors.fill: parent } diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index f4755b6c71..fa21b36f81 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -62,6 +62,7 @@ PresentWindowsEffect::PresentWindowsEffect() , m_hasKeyboardGrab(false) , m_mode(ModeCurrentDesktop) , m_managerWindow(NULL) + , m_needInitialSelection(false) , m_highlightedWindow(NULL) , m_filterFrame(NULL) , m_closeView(NULL) @@ -221,6 +222,10 @@ void PresentWindowsEffect::postPaintScreen() } effects->setActiveFullScreenEffect(NULL); effects->addRepaintFull(); + } else if (m_activated && m_needInitialSelection) { + m_needInitialSelection = false; + QMouseEvent me(QEvent::MouseMove, cursorPos(), Qt::NoButton, Qt::NoButton, Qt::NoModifier); + windowInputMouseEvent(&me); } // Update windows that are changing brightness or opacity @@ -330,7 +335,7 @@ void PresentWindowsEffect::paintWindow(EffectWindow *w, int mask, QRegion region m_motionManager.apply(w, data); QRect rect = m_motionManager.transformedGeometry(w).toRect(); - if (m_activated && winData->highlight > 0.0 && !m_motionManager.areWindowsMoving()) { + if (m_activated && winData->highlight > 0.0) { // scale the window (interpolated by the highlight level) to at least 105% or to cover 1/16 of the screen size - yet keep it in screen bounds QRect area = effects->clientArea(FullScreenArea, w); @@ -533,6 +538,7 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) // We cannot use m_motionManager.windowAtPoint() as the window might not be visible EffectWindowList windows = m_motionManager.managedWindows(); bool hovering = false; + EffectWindow *highlightCandidate = NULL; for (int i = 0; i < windows.size(); ++i) { DataHash::const_iterator winData = m_windowData.constFind(windows.at(i)); if (winData == m_windowData.constEnd()) @@ -541,7 +547,7 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) winData->visible && !winData->deleted) { hovering = true; if (windows.at(i) && m_highlightedWindow != windows.at(i) && !m_dragInProgress) - setHighlightedWindow(windows.at(i)); + highlightCandidate = windows.at(i); break; } } @@ -553,6 +559,8 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) m_closeView->hide(); if (e->type() == QEvent::MouseButtonRelease) { + if (highlightCandidate) + setHighlightedWindow(highlightCandidate); if (me->button() == Qt::LeftButton) { if (m_dragInProgress && m_dragWindow) { // handle drop @@ -612,13 +620,16 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) } effects->defineCursor(Qt::PointingHandCursor); } else if (e->type() == QEvent::MouseButtonPress && me->button() == Qt::LeftButton && hovering && m_dragToClose) { + if (highlightCandidate) + setHighlightedWindow(highlightCandidate); m_dragStart = me->pos(); m_dragWindow = m_highlightedWindow; m_dragInProgress = false; m_highlightedDropTarget = NULL; effects->setElevatedWindow(m_dragWindow, true); effects->addRepaintFull(); - } + } else if (highlightCandidate && !m_motionManager.areWindowsMoving()) + setHighlightedWindow(highlightCandidate); if (e->type() == QEvent::MouseMove && m_dragWindow) { if ((me->pos() - m_dragStart).manhattanLength() > KGlobalSettings::dndEventDelay() && !m_dragInProgress) { m_dragInProgress = true; @@ -1471,6 +1482,7 @@ void PresentWindowsEffect::setActive(bool active) return; m_activated = active; if (m_activated) { + m_needInitialSelection = true; m_closeButtonCorner = (Qt::Corner)effects->kwinOption(KWin::CloseButtonCorner).toInt(); m_decalOpacity = 0.0; m_highlightedWindow = NULL; @@ -1545,6 +1557,7 @@ void PresentWindowsEffect::setActive(bool active) } } } else { + m_needInitialSelection = false; if (m_highlightedWindow) effects->setElevatedWindow(m_highlightedWindow, false); // Fade in/out all windows @@ -1945,8 +1958,6 @@ CloseWindowView::CloseWindowView(QWindow *parent) setFlags(Qt::X11BypassWindowManagerHint); setColor(Qt::transparent); - rootContext()->setContextProperty(QStringLiteral("armed"), QVariant(false)); - setSource(QUrl(KStandardDirs::locate("data", QStringLiteral("kwin/effects/presentwindows/main.qml")))); if (QObject *item = rootObject()->findChild(QStringLiteral("closeButton"))) { connect(item, SIGNAL(clicked()), SIGNAL(requestClose())); @@ -1955,15 +1966,14 @@ CloseWindowView::CloseWindowView(QWindow *parent) // setup the timer - attempt to prevent accidental clicks m_armTimer->setSingleShot(true); m_armTimer->setInterval(350); // 50ms until the window is elevated (seen!) and 300ms more to be "realized" by the user. - connect(m_armTimer, SIGNAL(timeout()), SLOT(arm())); } void CloseWindowView::windowInputMouseEvent(QMouseEvent *e) { - if (m_armTimer->isActive()) - return; if (e->type() == QEvent::MouseMove) { mouseMoveEvent(e); + } else if (m_armTimer->isActive()) { + return; } else if (e->type() == QEvent::MouseButtonPress) { mousePressEvent(e); } else if (e->type() == QEvent::MouseButtonDblClick) { @@ -1973,17 +1983,19 @@ void CloseWindowView::windowInputMouseEvent(QMouseEvent *e) } } -void CloseWindowView::arm() -{ - rootContext()->setContextProperty(QStringLiteral("armed"), QVariant(true)); -} - void CloseWindowView::disarm() { - rootContext()->setContextProperty(QStringLiteral("armed"), QVariant(false)); m_armTimer->start(); } +void CloseWindowView::hideEvent(QHideEvent *event) +{ + const QPoint globalPos = mapToGlobal(QPoint(-1,-1)); + QMouseEvent me(QEvent::MouseMove, QPoint(-1,-1), globalPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier); + mouseMoveEvent(&me); + QQuickView::hideEvent(event); +} + } // namespace #include "presentwindows.moc" diff --git a/effects/presentwindows/presentwindows.h b/effects/presentwindows/presentwindows.h index 1733d029d1..4d31944f32 100644 --- a/effects/presentwindows/presentwindows.h +++ b/effects/presentwindows/presentwindows.h @@ -39,12 +39,13 @@ public: explicit CloseWindowView(QWindow *parent = 0); void windowInputMouseEvent(QMouseEvent* e); void disarm(); -public Q_SLOTS: - void arm(); Q_SIGNALS: void requestClose(); +protected: + void hideEvent(QHideEvent *event); + private: QTimer* m_armTimer; }; @@ -281,6 +282,7 @@ private: EffectWindowList m_selectedWindows; EffectWindow *m_managerWindow; QString m_class; + bool m_needInitialSelection; // Window data WindowMotionManager m_motionManager; diff --git a/effects/resize/resize.cpp b/effects/resize/resize.cpp index b5c6a65287..a24e1241f7 100644 --- a/effects/resize/resize.cpp +++ b/effects/resize/resize.cpp @@ -37,7 +37,8 @@ namespace KWin KWIN_EFFECT(resize, ResizeEffect) ResizeEffect::ResizeEffect() - : m_active(false) + : AnimationEffect() + , m_active(false) , m_resizeWindow(0) { reconfigure(ReconfigureAll); @@ -55,14 +56,14 @@ void ResizeEffect::prePaintScreen(ScreenPrePaintData& data, int time) if (m_active) { data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; } - effects->prePaintScreen(data, time); + AnimationEffect::prePaintScreen(data, time); } void ResizeEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) { if (m_active && w == m_resizeWindow) data.mask |= PAINT_WINDOW_TRANSFORMED; - effects->prePaintWindow(w, data, time); + AnimationEffect::prePaintWindow(w, data, time); } void ResizeEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) @@ -118,8 +119,9 @@ void ResizeEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Window } #endif } - } else - effects->paintWindow(w, mask, region, data); + } else { + AnimationEffect::paintWindow(w, mask, region, data); + } } void ResizeEffect::reconfigure(ReconfigureFlags) @@ -148,6 +150,8 @@ void ResizeEffect::slotWindowFinishUserMovedResized(EffectWindow *w) if (m_active && w == m_resizeWindow) { m_active = false; m_resizeWindow = NULL; + if (m_features & TextureScale) + animate(w, CrossFadePrevious, 0, 150, FPx2(1.0)); effects->addRepaintFull(); } } diff --git a/effects/resize/resize.desktop b/effects/resize/resize.desktop index 3a849ad8d6..c75772973e 100644 --- a/effects/resize/resize.desktop +++ b/effects/resize/resize.desktop @@ -21,7 +21,7 @@ Name[fi]=Ikkunan koon muuttaminen Name[fr]=Redimensionner la fenêtre Name[fy]=Finstergrutte feroarje Name[ga]=Athraigh Méid na Fuinneoige -Name[gl]=Mudar o tamaño da xanela +Name[gl]=Cambiar o tamaño da xanela Name[gu]=વિન્ડોનું માપ બદલો Name[he]=שינוי גודל חלון Name[hi]=विंडो आकार बदलें @@ -84,7 +84,7 @@ Comment[et]=Akende suuruse muutmine kiire tekstuuri skaleerimisega sisu uuendami Comment[eu]=Leihoen neurria aldatzen du testura eskalatze azkar batekin edukia eguneratu ordez Comment[fi]=Käyttää ikkunan kokoa muutettaessa nopeaa tekstuurin skaalausta sisällön päivittämisen sijaan Comment[fr]=Redimensionne les fenêtres à l'aide d'une échelle texturée rapide au lieu de mettre à jour les contenus -Comment[gl]=Muda o tamaño das xanelas escalando cunha textura rápida no canto de actualizar o contido +Comment[gl]=Cambia o tamaño das xanelas escalando cunha textura rápida no canto de actualizar o contido Comment[he]=שינוי גודל החלון על־ידי שינוי מהיר של גודל המבנה במקום לעדכן את התוכן Comment[hr]=Mijenja veličinu prozora brzim skaliranjem teksture umjesto ažuriranjem sadržaja Comment[hu]=Gyors textúraskálázással méretezi át az ablakokat a tartalom frissítése helyett diff --git a/effects/resize/resize.h b/effects/resize/resize.h index d900ea6adf..5b1610fe06 100644 --- a/effects/resize/resize.h +++ b/effects/resize/resize.h @@ -21,13 +21,13 @@ along with this program. If not, see . #ifndef KWIN_RESIZE_H #define KWIN_RESIZE_H -#include +#include namespace KWin { class ResizeEffect - : public Effect + : public AnimationEffect { Q_OBJECT Q_PROPERTY(bool textureScale READ isTextureScale) @@ -38,7 +38,7 @@ public: virtual inline bool provides(Effect::Feature ef) { return ef == Effect::Resize; } - inline bool isActive() const { return m_active; } + inline bool isActive() const { return m_active || AnimationEffect::isActive(); } virtual void prePaintScreen(ScreenPrePaintData& data, int time); virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); diff --git a/effects/resize/resize_config.desktop b/effects/resize/resize_config.desktop index 647e6832e0..6fec3aa08d 100644 --- a/effects/resize/resize_config.desktop +++ b/effects/resize/resize_config.desktop @@ -28,7 +28,7 @@ Name[fi]=Ikkunan koon muuttaminen Name[fr]=Redimensionner la fenêtre Name[fy]=Finstergrutte feroarje Name[ga]=Athraigh Méid na Fuinneoige -Name[gl]=Mudar o tamaño da xanela +Name[gl]=Cambiar o tamaño da xanela Name[gu]=વિન્ડોનું માપ બદલો Name[he]=שינוי גודל חלון Name[hi]=विंडो आकार बदलें diff --git a/effects/screenedge/screenedgeeffect.desktop b/effects/screenedge/screenedgeeffect.desktop index e750ef6e91..87ebd7f3aa 100644 --- a/effects/screenedge/screenedgeeffect.desktop +++ b/effects/screenedge/screenedgeeffect.desktop @@ -1,7 +1,9 @@ [Desktop Entry] Name=Screen Edge +Name[bs]=Ivice ekrana Name[ca]=Vora de la pantalla Name[cs]=Hrana obrazovky +Name[da]=Skærmkant Name[de]=Bildschirmkante Name[el]=Άκρο οθόνης Name[es]=Borde de la pantalla @@ -10,7 +12,9 @@ Name[fr]=Bord de l'écran Name[gl]=Beira da pantalla Name[hu]=Képernyőszél Name[ia]=Margines de schermo +Name[it]=Bordo dello schermo Name[kk]=Экран жиегі +Name[ko]=화면 경계 Name[lt]=Ekrano kraštas Name[mr]=स्क्रीन किनारा Name[nb]=Skjermkant @@ -28,14 +32,17 @@ Name[sr@ijekavianlatin]=Ivica ekrana Name[sr@latin]=Ivica ekrana Name[sv]=Skärmkant Name[tr]=Ekran Kenarı +Name[ug]=ئېكران گىرۋىكى Name[uk]=Край екрана Name[x-test]=xxScreen Edgexx Name[zh_CN]=屏幕边缘 Name[zh_TW]=螢幕邊緣 Icon=preferences-system-windows-effect-screenedge Comment=Highlights a screen edge when approaching +Comment[bs]=Označava ivicu ekrana pri približavanju Comment[ca]=Ressalta la vora de la pantalla en aproximar-se Comment[cs]=Zvýrazní hranu obrazovky při přiblížení k ní +Comment[da]=Fremhæver en skærmkant når den nærmer sig Comment[de]=Bildschirmkante bei Annäherung hervorheben Comment[el]=Εμφανίζει τονισμένο το άκρο της οθόνης όταν το πλησιάζετε Comment[es]=Resalta el borde de la pantalla al aproximarse a él @@ -44,7 +51,9 @@ Comment[fr]=Mettre en valeur le bord de l'écran à l'approche Comment[gl]=Realza unha beira da pantalla cando se aproxima Comment[hu]=Kiemeli a képernyő szélét megközelítéskor Comment[ia]=Evidentia un margine de schermo quando on approxima se +Comment[it]=Evidenzia il bordo dello schermo quando ti avvicini Comment[kk]=Экран жиегіне жақындағанда оны бояп белгілеу +Comment[ko]=화면 경계에 도달할 때 강조하기 Comment[lt]=Paryškina ekrano kraštą kai priartėjama Comment[mr]=पोहोचताना स्क्रीन किनारे ठळक करतो Comment[nb]=Fremhever en skjermkant når den kommer nær diff --git a/effects/screenshot/screenshot.desktop b/effects/screenshot/screenshot.desktop index d1094f9719..06c25caab8 100644 --- a/effects/screenshot/screenshot.desktop +++ b/effects/screenshot/screenshot.desktop @@ -54,7 +54,7 @@ Name[sv]=Skärmbild Name[tg]=Сурати экран Name[th]=จับภาพหน้าจอ Name[tr]=Ekran Görüntüsü -Name[ug]=ئېكران كەسمىسى +Name[ug]=ئېكران كۆرۈنۈشى Name[uk]=Знімок вікна Name[wa]=Waitroûlêye Name[x-test]=xxScreenshotxx diff --git a/effects/showfps/showfps.cpp b/effects/showfps/showfps.cpp index 0439941b23..1ab7d57f6d 100644 --- a/effects/showfps/showfps.cpp +++ b/effects/showfps/showfps.cpp @@ -232,7 +232,18 @@ void ShowFpsEffect::paintGL(int fps) paintDrawSizeGraph(x, y); // Paint FPS numerical value - paintFPSText(fps); + if (fpsTextRect.isValid()) { + delete fpsText; + fpsText = new GLTexture(fpsTextImage(fps)); + fpsText->bind(); + ShaderBinder binder(ShaderManager::SimpleShader); + if (effects->compositingType() == OpenGL2Compositing) { + binder.shader()->setUniform("offset", QVector2D(0, 0)); + } + fpsText->render(QRegion(fpsTextRect), fpsTextRect); + fpsText->unbind(); + effects->addRepaint(fpsTextRect); + } // Paint paint sizes glDisable(GL_BLEND); @@ -284,6 +295,15 @@ void ShowFpsEffect::paintXrender(int fps) // Paint amount of rendered pixels graph paintDrawSizeGraph(x + FPS_WIDTH + MAX_TIME, y); + + // Paint FPS numerical value + if (fpsTextRect.isValid()) { + QImage textImg(fpsTextImage(fps)); + XRenderPicture textPic(textImg); + xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, textPic, XCB_RENDER_PICTURE_NONE, + effects->xrenderBufferPicture(), 0, 0, 0, 0, fpsTextRect.x(), fpsTextRect.y(), textImg.width(), textImg.height()); + effects->addRepaint(fpsTextRect); + } } #endif @@ -450,26 +470,16 @@ void ShowFpsEffect::postPaintScreen() effects->addRepaint(fps_rect); } -void ShowFpsEffect::paintFPSText(int fps) +QImage ShowFpsEffect::fpsTextImage(int fps) { - if (!fpsTextRect.isValid()) - return; QImage im(100, 100, QImage::Format_ARGB32); - im.fill(0); + im.fill(Qt::transparent); QPainter painter(&im); painter.setFont(textFont); painter.setPen(textColor); painter.drawText(QRect(0, 0, 100, 100), textAlign, QString::number(fps)); - delete fpsText; - fpsText = new GLTexture(im); - fpsText->bind(); - ShaderBinder binder(ShaderManager::SimpleShader); - if (effects->compositingType() == OpenGL2Compositing) { - binder.shader()->setUniform("offset", QVector2D(0, 0)); - } - fpsText->render(QRegion(fpsTextRect), fpsTextRect); - fpsText->unbind(); - effects->addRepaint(fpsTextRect); + painter.end(); + return im; } } // namespace diff --git a/effects/showfps/showfps.h b/effects/showfps/showfps.h index 5f46d0c5d5..3c30c39be0 100644 --- a/effects/showfps/showfps.h +++ b/effects/showfps/showfps.h @@ -80,7 +80,7 @@ private: void paintFPSGraph(int x, int y); void paintDrawSizeGraph(int x, int y); void paintGraph(int x, int y, QList values, QList lines, bool colorize); - void paintFPSText(int fps); + QImage fpsTextImage(int fps); QTime t; enum { NUM_PAINTS = 100 }; // remember time needed to paint this many paints int paints[ NUM_PAINTS ]; // time needed to paint diff --git a/effects/slideback/slideback.desktop b/effects/slideback/slideback.desktop index 9f45c8ac66..1de2308d9a 100644 --- a/effects/slideback/slideback.desktop +++ b/effects/slideback/slideback.desktop @@ -70,13 +70,19 @@ Name[zh_TW]=往回滑動 Type=Service Comment=Slide back windows when another window is raised +Comment[bs]=Kliza unazad prozore kada se drugi prozor oslobodi Comment[ca]=Llisca enrere les finestres quan s'eleva una altra finestra +Comment[da]=Glid vinduer tilbage når et andet vinduet hæves +Comment[de]=Fenster nach hinten gleiten wenn ein anderes Fenster aktiviert wird. Comment[es]=Desliza las ventanas atrás cuando una ventana pasa a primer plano Comment[fi]=Ikkunaa nostettaessa liu’uttaa muut ikkunat sen taakse Comment[fr]=Faire glisser en arrière les fenêtres lors de l'apparition d'une autre fenêtre Comment[gl]=Despraza cara atrás as xanelas cando outra se eleva +Comment[hu]=Ablakok visszacsúsztatása másik ablak előtérbe hozásakor Comment[ia]=Glissa retro fenestras quando un altere fenestra es elevate +Comment[it]=Fai scivolare indietro le altre finestre quando una nuova finestra appare Comment[kk]=Басқа терезе алдына шығарылғанда терезелерді сырғанату. +Comment[ko]=다른 창을 올렸을 때 창 뒤로 밀기 Comment[lt]=Slinkti atgal langus, kai kitas langas yra pakeliamas Comment[nb]=Skyv tilbake vinduer når et annet vindu heves Comment[nl]=Schuif vensters terug wanneer een ander venster omhoog komt diff --git a/effects/startupfeedback/startupfeedback.cpp b/effects/startupfeedback/startupfeedback.cpp index 3486054ed9..8f3765fac3 100644 --- a/effects/startupfeedback/startupfeedback.cpp +++ b/effects/startupfeedback/startupfeedback.cpp @@ -155,7 +155,9 @@ void StartupFeedbackEffect::prePaintScreen(ScreenPrePaintData& data, int time) switch(m_type) { case BouncingFeedback: m_progress = (m_progress + time) % BOUNCE_DURATION; - m_frame = qRound((qreal)m_progress / (qreal)BOUNCE_FRAME_DURATION) % BOUNCE_FRAMES;; + m_frame = qRound((qreal)m_progress / (qreal)BOUNCE_FRAME_DURATION) % BOUNCE_FRAMES; + m_currentGeometry = feedbackRect(); // bounce alters geometry with m_frame + data.paint.unite(m_currentGeometry); break; case BlinkingFeedback: m_progress = (m_progress + time) % BLINKING_DURATION; @@ -164,10 +166,6 @@ void StartupFeedbackEffect::prePaintScreen(ScreenPrePaintData& data, int time) default: break; // nothing } - data.paint.unite(m_dirtyRect); - m_dirtyRect = QRect(); - m_currentGeometry = feedbackRect(); - data.paint.unite(m_currentGeometry); } effects->prePaintScreen(data, time); } @@ -243,18 +241,9 @@ void StartupFeedbackEffect::paintScreen(int mask, QRegion region, ScreenPaintDat void StartupFeedbackEffect::postPaintScreen() { if (m_active) { - switch(m_type) { - case BouncingFeedback: // fall through - case BlinkingFeedback: - // repaint the icon - m_dirtyRect = m_currentGeometry; - effects->addRepaint(m_dirtyRect); - break; - case PassiveFeedback: // fall through - default: - // no need to repaint - no change - break; - } + m_dirtyRect = m_currentGeometry; // ensure the now dirty region is cleaned on the next pass + if (m_type == BlinkingFeedback || m_type == BouncingFeedback) + effects->addRepaint(m_dirtyRect); // we also have to trigger a repaint } effects->postPaintScreen(); } @@ -324,7 +313,7 @@ void StartupFeedbackEffect::start(const QString& icon) iconPixmap = SmallIcon(QStringLiteral("system-run")); prepareTextures(iconPixmap); m_dirtyRect = m_currentGeometry = feedbackRect(); - effects->addRepaintFull(); + effects->addRepaint(m_dirtyRect); } void StartupFeedbackEffect::stop() diff --git a/effects/windowgeometry/windowgeometry.cpp b/effects/windowgeometry/windowgeometry.cpp index 4bbf10e60d..3d0c978a06 100644 --- a/effects/windowgeometry/windowgeometry.cpp +++ b/effects/windowgeometry/windowgeometry.cpp @@ -148,7 +148,7 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect { if (iAmActivated && iAmActive && w == myResizeWindow) { if (myExtraDirtyArea.isValid()) - w->addLayerRepaint(myExtraDirtyArea); + effects->addRepaint(myExtraDirtyArea); myExtraDirtyArea = QRect(); @@ -200,11 +200,9 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect myExtraDirtyArea |= myMeasure[1]->geometry(); myExtraDirtyArea |= myMeasure[2]->geometry(); myExtraDirtyArea.adjust(-6,-6,6,6); - if (w->expandedGeometry().contains(myExtraDirtyArea)) - myExtraDirtyArea = QRect(); if (myExtraDirtyArea.isValid()) - w->addLayerRepaint(myExtraDirtyArea); + effects->addRepaint(myExtraDirtyArea); } } diff --git a/effects/windowgeometry/windowgeometry.desktop b/effects/windowgeometry/windowgeometry.desktop index 7c75a7a2e2..2f6fd9e95d 100644 --- a/effects/windowgeometry/windowgeometry.desktop +++ b/effects/windowgeometry/windowgeometry.desktop @@ -69,7 +69,7 @@ Comment[et]=Akende geomeetria kuvamine liigutamisel või suuruse muutmisel Comment[eu]=Bistaratu leiho geometriak mugitu edo neurri aldatzerakoan Comment[fi]=Näytä ikkunan mitat, kun sitä liikutetaan tai sen kokoa muutetaan Comment[fr]=Affiche la géométrie de la fenêtre pendant son déplacement ou son redimensionnement -Comment[gl]=Mostra a xeometría da xanela ao mover ou mudar o tamaño +Comment[gl]=Mostra a xeometría da xanela ao mover ou cambiar o tamaño Comment[he]=מציג גדלי החלון בהזזתו או בשינוי גודלו Comment[hr]=Prikaži geometriju prozora pri micanju i mijenjanju veličine Comment[hu]=Megjeleníti az ablakméretet mozgatás és átméretezés közben diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 3752bb1f98..236d4abe40 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -259,7 +259,8 @@ void ZoomEffect::prePaintScreen(ScreenPrePaintData& data, int time) if (zoom == 1.0) { showCursor(); - if (altered) // reset the generic shader to avoid artifacts in plenty other effects + // reset the generic shader to avoid artifacts in plenty other effects + if (altered && effects->isOpenGLCompositing()) ShaderBinder binder(ShaderManager::GenericShader, true); } else { hideCursor(); diff --git a/effects/zoom/zoom_config.cpp b/effects/zoom/zoom_config.cpp index 41e6015e6b..dc4b2554e7 100644 --- a/effects/zoom/zoom_config.cpp +++ b/effects/zoom/zoom_config.cpp @@ -54,6 +54,8 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) : addConfig(ZoomConfig::self(), m_ui); + connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + #warning Global Shortcuts need porting #if KWIN_QT5_PORTING // Shortcut config. The shortcut belongs to the component "kwin"! diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 73c3ff4ca9..1685002b3a 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -72,6 +72,11 @@ void EglOnXBackend::init() } GLPlatform *glPlatform = GLPlatform::instance(); glPlatform->detect(EglPlatformInterface); + if (GLPlatform::instance()->driver() == Driver_Intel) + options->setUnredirectFullscreen(false); // bug #252817 + options->setGlPreferBufferSwap(options->glPreferBufferSwap()); // resolve autosetting + if (options->glPreferBufferSwap() == Options::AutoSwapStrategy) + options->setGlPreferBufferSwap('e'); // for unknown drivers - should not happen glPlatform->printResults(); initGL(EglPlatformInterface); if (!hasGLExtension(QStringLiteral("GL_OES_EGL_image"))) { @@ -275,6 +280,18 @@ void EglOnXBackend::present() eglWaitGL(); if (char result = m_swapProfiler.end()) { gs_tripleBufferUndetected = gs_tripleBufferNeedsDetection = false; + if (result == 'd' && GLPlatform::instance()->driver() == Driver_NVidia) { + // TODO this is a workaround, we should get __GL_YIELD set before libGL checks it + if (qstrcmp(qgetenv("__GL_YIELD"), "USLEEP")) { + options->setGlPreferBufferSwap(0); + eglSwapInterval(dpy, 0); + kWarning(1212) << "\nIt seems you are using the nvidia driver without triple buffering\n" + "You must export __GL_YIELD=\"USLEEP\" to prevent large CPU overhead on synced swaps\n" + "Preferably, enable the TripleBuffer Option in the xorg.conf Device\n" + "For this reason, the tearing prevention has been disabled.\n" + "See https://bugs.kde.org/show_bug.cgi?id=322060\n"; + } + } setBlocksForRetrace(result == 'd'); } } diff --git a/events.cpp b/events.cpp index b433db6d7b..3cab63cef8 100644 --- a/events.cpp +++ b/events.cpp @@ -59,6 +59,7 @@ along with this program. If not, see . #include #include #include +#include #include "composite.h" #include "killwindow.h" @@ -1245,10 +1246,10 @@ void Client::checkQuickTilingMaximizationZones(int xroot, int yroot) QuickTileMode mode = QuickTileNone; for (int i=0; icount(); ++i) { - const QRect &area = screens()->geometry(i); - if (!area.contains(QPoint(xroot, yroot))) + if (!screens()->geometry(i).contains(QPoint(xroot, yroot))) continue; + QRect area = workspace()->clientArea(MaximizeArea, QPoint(xroot, yroot), desktop()); if (options->electricBorderTiling()) { if (xroot <= area.x() + 20) mode |= QuickTileLeft; @@ -1305,15 +1306,15 @@ bool Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_ro workspace()->scheduleMouseMotionCompression([this, x, y, x_root, y_root]() { const QRect oldGeo = geometry(); handleMoveResize(x, y, x_root, y_root); - if (!isFullScreen() && isMove() && oldGeo != geometry()) { - if (quick_tile_mode != QuickTileNone) { + if (!isFullScreen() && isMove()) { + if (quick_tile_mode != QuickTileNone && oldGeo != geometry()) { GeometryUpdatesBlocker blocker(this); setQuickTileMode(QuickTileNone); moveOffset = QPoint(double(moveOffset.x()) / double(oldGeo.width()) * double(geom_restore.width()), double(moveOffset.y()) / double(oldGeo.height()) * double(geom_restore.height())); moveResizeGeom = geom_restore; handleMoveResize(x, y, x_root, y_root); // fix position - } else if (isResizable()) { + } else if (quick_tile_mode == QuickTileNone && isResizable()) { checkQuickTilingMaximizationZones(x_root, y_root); } } diff --git a/geometry.cpp b/geometry.cpp index 4b7ca8ae53..4a432d7fea 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -56,6 +56,10 @@ along with this program. If not, see . namespace KWin { +static inline int sign(int v) { + return (v > 0) - (v < 0); +} + //******************************************** // Workspace //******************************************** @@ -433,20 +437,20 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted, padding[3] = 0; if ((sOWO ? (cx < xmin) : true) && (qAbs(xmin - cx) < snapX)) { - deltaX = xmin - (cx - padding[0]); + deltaX = xmin - cx; nx = xmin - padding[0]; } if ((sOWO ? (rx > xmax) : true) && (qAbs(rx - xmax) < snapX) && (qAbs(xmax - rx) < deltaX)) { - deltaX = rx + padding[1] - xmax; + deltaX = rx - xmax; nx = xmax - cw + padding[1]; } if ((sOWO ? (cy < ymin) : true) && (qAbs(ymin - cy) < snapY)) { - deltaY = ymin - (cy - padding[2]); + deltaY = ymin - cy; ny = ymin - padding[2]; } if ((sOWO ? (ry > ymax) : true) && (qAbs(ry - ymax) < snapY) && (qAbs(ymax - ry) < deltaY)) { - deltaY = ry + padding[3] - ymax; + deltaY = ry - ymax; ny = ymax - ch + padding[3]; } } @@ -456,63 +460,66 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted, if (snap) { QList::ConstIterator l; for (l = clients.constBegin(); l != clients.constEnd(); ++l) { - if ((((*l)->isOnDesktop(c->desktop()) && !(*l)->isMinimized()) - || (c->isOnDesktop(NET::OnAllDesktops) && (*l)->isOnDesktop(VirtualDesktopManager::self()->current()) - && !(*l)->isMinimized())) - && (!(*l)->tabGroup() || (*l) == (*l)->tabGroup()->current()) - && (*l) != c) { - lx = (*l)->x(); - ly = (*l)->y(); - lrx = lx + (*l)->width(); - lry = ly + (*l)->height(); + if ((*l) == c) + continue; + if ((*l)->isMinimized()) + continue; // is minimized + if ((*l)->tabGroup() && (*l) != (*l)->tabGroup()->current()) + continue; // is not active tab + if (!((*l)->isOnDesktop(c->desktop()) || c->isOnDesktop((*l)->desktop()))) + continue; // wrong virtual desktop + if (!(*l)->isOnCurrentActivity()) + continue; // wrong activity + if ((*l)->isDesktop() || (*l)->isSplash()) + continue; - if (((cy <= lry) && (cy >= ly)) || - ((ry >= ly) && (ry <= lry)) || - ((cy <= ly) && (ry >= lry))) { - if ((sOWO ? (cx < lrx) : true) && (qAbs(lrx - cx) < snap) && (qAbs(lrx - cx) < deltaX)) { - deltaX = qAbs(lrx - cx); - nx = lrx; - } - if ((sOWO ? (rx > lx) : true) && (qAbs(rx - lx) < snap) && (qAbs(rx - lx) < deltaX)) { - deltaX = qAbs(rx - lx); - nx = lx - cw; - } - } + lx = (*l)->x(); + ly = (*l)->y(); + lrx = lx + (*l)->width(); + lry = ly + (*l)->height(); - if (((cx <= lrx) && (cx >= lx)) || - ((rx >= lx) && (rx <= lrx)) || - ((cx <= lx) && (rx >= lrx))) { - if ((sOWO ? (cy < lry) : true) && (qAbs(lry - cy) < snap) && (qAbs(lry - cy) < deltaY)) { - deltaY = qAbs(lry - cy); - ny = lry; - } - //if ( (qAbs( ry-ly ) < snap) && (qAbs( ry - ly ) < deltaY )) - if ((sOWO ? (ry > ly) : true) && (qAbs(ry - ly) < snap) && (qAbs(ry - ly) < deltaY)) { - deltaY = qAbs(ry - ly); - ny = ly - ch; - } + if (((cy <= lry) && (cy >= ly)) || ((ry >= ly) && (ry <= lry)) || ((cy <= ly) && (ry >= lry))) { + if ((sOWO ? (cx < lrx) : true) && (qAbs(lrx - cx) < snap) && (qAbs(lrx - cx) < deltaX)) { + deltaX = qAbs(lrx - cx); + nx = lrx; } + if ((sOWO ? (rx > lx) : true) && (qAbs(rx - lx) < snap) && (qAbs(rx - lx) < deltaX)) { + deltaX = qAbs(rx - lx); + nx = lx - cw; + } + } - // Corner snapping - if (nx == lrx || nx + cw == lx) { - if ((sOWO ? (ry > lry) : true) && (qAbs(lry - ry) < snap) && (qAbs(lry - ry) < deltaY)) { - deltaY = qAbs(lry - ry); - ny = lry - ch; - } - if ((sOWO ? (cy < ly) : true) && (qAbs(cy - ly) < snap) && (qAbs(cy - ly) < deltaY)) { - deltaY = qAbs(cy - ly); - ny = ly; - } + if (((cx <= lrx) && (cx >= lx)) || ((rx >= lx) && (rx <= lrx)) || ((cx <= lx) && (rx >= lrx))) { + if ((sOWO ? (cy < lry) : true) && (qAbs(lry - cy) < snap) && (qAbs(lry - cy) < deltaY)) { + deltaY = qAbs(lry - cy); + ny = lry; } - if (ny == lry || ny + ch == ly) { - if ((sOWO ? (rx > lrx) : true) && (qAbs(lrx - rx) < snap) && (qAbs(lrx - rx) < deltaX)) { - deltaX = qAbs(lrx - rx); - nx = lrx - cw; - } - if ((sOWO ? (cx < lx) : true) && (qAbs(cx - lx) < snap) && (qAbs(cx - lx) < deltaX)) { - deltaX = qAbs(cx - lx); - nx = lx; - } + //if ( (qAbs( ry-ly ) < snap) && (qAbs( ry - ly ) < deltaY )) + if ((sOWO ? (ry > ly) : true) && (qAbs(ry - ly) < snap) && (qAbs(ry - ly) < deltaY)) { + deltaY = qAbs(ry - ly); + ny = ly - ch; + } + } + + // Corner snapping + if (nx == lrx || nx + cw == lx) { + if ((sOWO ? (ry > lry) : true) && (qAbs(lry - ry) < snap) && (qAbs(lry - ry) < deltaY)) { + deltaY = qAbs(lry - ry); + ny = lry - ch; + } + if ((sOWO ? (cy < ly) : true) && (qAbs(cy - ly) < snap) && (qAbs(cy - ly) < deltaY)) { + deltaY = qAbs(cy - ly); + ny = ly; + } + } + if (ny == lry || ny + ch == ly) { + if ((sOWO ? (rx > lrx) : true) && (qAbs(lrx - rx) < snap) && (qAbs(lrx - rx) < deltaX)) { + deltaX = qAbs(lrx - rx); + nx = lrx - cw; + } + if ((sOWO ? (cx < lx) : true) && (qAbs(cx - lx) < snap) && (qAbs(cx - lx) < deltaX)) { + deltaX = qAbs(cx - lx); + nx = lx; } } } @@ -525,20 +532,16 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted, int diffY = qAbs((ymin + ymax) / 2 - (cy + ch / 2)); if (diffX < snap && diffY < snap && diffX < deltaX && diffY < deltaY) { // Snap to center of screen - deltaX = diffX; - deltaY = diffY; nx = (xmin + xmax) / 2 - cw / 2; ny = (ymin + ymax) / 2 - ch / 2; } else if (options->borderSnapZone()) { // Enhance border snap if ((nx == xmin || nx == xmax - cw) && diffY < snap && diffY < deltaY) { // Snap to vertical center on screen edge - deltaY = diffY; ny = (ymin + ymax) / 2 - ch / 2; } else if (((unrestricted ? ny == ymin : ny <= ymin) || ny == ymax - ch) && diffX < snap && diffX < deltaX) { // Snap to horizontal center on screen edge - deltaX = diffX; nx = (xmin + xmax) / 2 - cw / 2; } } @@ -1599,24 +1602,43 @@ const QPoint Client::calculateGravitation(bool invert, int gravity) const void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool) { - if (rules()->checkIgnoreGeometry(false)) - return; // user said: "FU!" - // "maximized" is a user setting -> we do not allow the client to resize itself // away from this & against the users explicit wish kDebug(1212) << this << bool(value_mask & (CWX|CWWidth|CWY|CWHeight)) << bool(maximizeMode() & MaximizeVertical) << bool(maximizeMode() & MaximizeHorizontal); - if (!app_noborder) { // - if (maximizeMode() & MaximizeVertical) - value_mask &= ~(CWY|CWHeight); // do not allow clients to drop out of vertical ... - if (maximizeMode() & MaximizeHorizontal) - value_mask &= ~(CWX|CWWidth); // .. or horizontal maximization (MaximizeFull == MaximizeVertical|MaximizeHorizontal) + + // we want to (partially) ignore the request when the window is somehow maximized or quicktiled + bool ignore = !app_noborder && (quick_tile_mode != QuickTileNone || maximizeMode() != MaximizeRestore); + // however, the user shall be able to force obedience despite and also disobedience in general + ignore = rules()->checkIgnoreGeometry(ignore); + if (!ignore) { // either we're not max'd / q'tiled or the user allowed the client to break that - so break it. + quick_tile_mode = QuickTileNone; + max_mode = MaximizeRestore; + } else if (!app_noborder && quick_tile_mode == QuickTileNone && + (maximizeMode() == MaximizeVertical || maximizeMode() == MaximizeHorizontal)) { + // ignoring can be, because either we do, or the user does explicitly not want it. + // for partially maximized windows we want to allow configures in the other dimension. + // so we've to ask the user again - to know whether we just ignored for the partial maximization. + // the problem here is, that the user can explicitly permit configure requests - even for maximized windows! + // we cannot distinguish that from passing "false" for partially maximized windows. + ignore = rules()->checkIgnoreGeometry(false); + if (!ignore) { // the user is not interested, so we fix up dimensions + if (maximizeMode() == MaximizeVertical) + value_mask &= ~(CWY|CWHeight); + if (maximizeMode() == MaximizeHorizontal) + value_mask &= ~(CWX|CWWidth); + if (!(value_mask & (CWX|CWWidth|CWY|CWHeight))) { + ignore = true; // the modification turned the request void + } + } } - if (!(value_mask & (CWX|CWWidth|CWY|CWHeight))) { + + if (ignore) { kDebug(1212) << "DENIED"; - return; // nothing to (left) to do for use - bugs #158974, #252314 + return; // nothing to (left) to do for use - bugs #158974, #252314, #321491 } + kDebug(1212) << "PERMITTED" << this << bool(value_mask & (CWX|CWWidth|CWY|CWHeight)); if (gravity == 0) // default (nonsense) value for the argument @@ -2093,12 +2115,15 @@ void Client::maximize(MaximizeMode m) void Client::setMaximize(bool vertically, bool horizontally) { // changeMaximize() flips the state, so change from set->flip + MaximizeMode oldMode = maximizeMode(); changeMaximize( max_mode & MaximizeVertical ? !vertically : vertically, max_mode & MaximizeHorizontal ? !horizontally : horizontally, false); - emit clientMaximizedStateChanged(this, max_mode); - emit clientMaximizedStateChanged(this, vertically, horizontally); + if (oldMode != maximizeMode()) { + emit clientMaximizedStateChanged(this, max_mode); + emit clientMaximizedStateChanged(this, vertically, horizontally); + } } @@ -2847,6 +2872,7 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root) // we are trying to resize in from the side? bool breakLoop = false; switch(mode) { + case PositionBottomLeft: case PositionTopLeft: case PositionLeft: if (previousMoveResizeGeom.x() >= moveResizeGeom.x()) { @@ -2855,6 +2881,7 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root) } moveResizeGeom.setLeft(moveResizeGeom.x() - 1); break; + case PositionBottomRight: case PositionTopRight: case PositionRight: if (previousMoveResizeGeom.right() <= moveResizeGeom.right()) { @@ -2980,13 +3007,16 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root) } } - // Move it (Favour vertically) - if (previousMoveResizeGeom.y() != moveResizeGeom.y()) - moveResizeGeom.translate(0, - previousMoveResizeGeom.y() > moveResizeGeom.y() ? 1 : -1); - else - moveResizeGeom.translate(previousMoveResizeGeom.x() > moveResizeGeom.x() ? 1 : -1, - 0); + int dx = sign(previousMoveResizeGeom.x() - moveResizeGeom.x()), + dy = sign(previousMoveResizeGeom.y() - moveResizeGeom.y()); + if (visiblePixels && dx) // means there's no full width cap -> favor horizontally + dy = 0; + else if (dy) + dx = 0; + + // Move it back + moveResizeGeom.translate(dx, dy); + if (moveResizeGeom == previousMoveResizeGeom) { break; // Prevent lockup } diff --git a/glxbackend.cpp b/glxbackend.cpp index 19fbb2529c..f0d8780bc2 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -94,6 +94,11 @@ void GlxBackend::init() // Initialize OpenGL GLPlatform *glPlatform = GLPlatform::instance(); glPlatform->detect(GlxPlatformInterface); + if (GLPlatform::instance()->driver() == Driver_Intel) + options->setUnredirectFullscreen(false); // bug #252817 + options->setGlPreferBufferSwap(options->glPreferBufferSwap()); // resolve autosetting + if (options->glPreferBufferSwap() == Options::AutoSwapStrategy) + options->setGlPreferBufferSwap('e'); // for unknown drivers - should not happen glPlatform->printResults(); initGL(GlxPlatformInterface); // Check whether certain features are supported @@ -168,6 +173,8 @@ bool GlxBackend::initRenderingContext() }; const int attribs_legacy[] = { + GLX_CONTEXT_MAJOR_VERSION_ARB, 1, + GLX_CONTEXT_MINOR_VERSION_ARB, 2, 0 }; @@ -427,6 +434,18 @@ void GlxBackend::present() glXWaitGL(); if (char result = m_swapProfiler.end()) { gs_tripleBufferUndetected = gs_tripleBufferNeedsDetection = false; + if (result == 'd' && GLPlatform::instance()->driver() == Driver_NVidia) { + // TODO this is a workaround, we should get __GL_YIELD set before libGL checks it + if (qstrcmp(qgetenv("__GL_YIELD"), "USLEEP")) { + options->setGlPreferBufferSwap(0); + setSwapInterval(0); + kWarning(1212) << "\nIt seems you are using the nvidia driver without triple buffering\n" + "You must export __GL_YIELD=\"USLEEP\" to prevent large CPU overhead on synced swaps\n" + "Preferably, enable the TripleBuffer Option in the xorg.conf Device\n" + "For this reason, the tearing prevention has been disabled.\n" + "See https://bugs.kde.org/show_bug.cgi?id=322060\n"; + } + } setBlocksForRetrace(result == 'd'); } } diff --git a/group.cpp b/group.cpp index 9b6e3f4b6c..0c4c222b8c 100644 --- a/group.cpp +++ b/group.cpp @@ -816,7 +816,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, bool set new_transient_for = rootWindow(); } if (new_property_value != m_originalTransientForId) - xcb_icccm_set_wm_transient_for(connection(), window(), new_property_value); + Xcb::setTransientFor(window(), new_property_value); return new_transient_for; } diff --git a/kcmkwin/kwincompositing/kwincompositing.desktop b/kcmkwin/kwincompositing/kwincompositing.desktop index 55c6ce93bd..7654edfd8c 100644 --- a/kcmkwin/kwincompositing/kwincompositing.desktop +++ b/kcmkwin/kwincompositing/kwincompositing.desktop @@ -87,7 +87,7 @@ Name[te]=డెస్‍క్ టాప్ ప్రభావాలు Name[tg]=Воситаҳои мизи корӣ Name[th]=ลูกเล่นของพื้นที่ทำงาน Name[tr]=Masaüstü Efektleri -Name[ug]=ئۈستەلئۈستى ئۈنۈملەر +Name[ug]=ئۈستەلئۈستى ئۈنۈملىرى Name[uk]=Ефекти стільниці Name[uz]=Ish stoli effektlari Name[uz@cyrillic]=Иш столи эффектлари @@ -194,6 +194,7 @@ X-KDE-Keywords[fr]=kwin, fenêtre, gestionnaire, composition, effet, effets 3D, X-KDE-Keywords[gl]=kwin,xanela,xestor,composición,efecto,efectos 3D,efectos 2D,OpenGl,XRender, configuración da imaxe,efectos gráficos, efectos do escritorio, animacións, efectos da xestión das xanelas,troco de xanela,animación,velocidade,controlador, render X-KDE-Keywords[hu]=kwin,ablak,kezelő,kompozitálás,hatás,3D hatás,2D hatás,OpenGL,XRender,videobeállítások,grafikai hatások,asztali hatások,animációk,különféle animációk,ablakkezelő hatások,ablakváltó hatások,asztalváltó hatások,animációk,animáció sebesség,asztali animációk,meghajtók,meghajtó beállítások,leképezés,renderelés,fordított hatás,tükörhatás,nagyító hatás,elkapás segítő hatás,egérkövetés hatás,nagyítás hatás,elmosás hatás,áttekintő hatás,robbanás hatás,elhalványulás hatás,asztal elhalványulása hatás,széteső hatás,csúszás hatás,ablak kiemelése hatás,belépés hatás,kilépés hatás,varázslámpa hatás,minimalizálás animáció hatás,egérjelölés hatás,méretezés hatás,képernyőkép hatás,munkalap hatás,dia hatás,csúszó felugrók hatás,feladatsáv bélyegképek hatás,bélyegképek félre hatás,áttetszőség,áttetszőség hatás,átlátszóság,ablak geometria hatás,ingó ablak hatás,indulási visszajelzés hatás,párbeszédablak szülő hatás,dim inaktív hatás,dim kijelző hatás,dia vissza hatás,látványelem,édesség,FPS megjelenítése hatás,festék megjelenése hatás,dobozváltás hatás,eltakarás váltás hatás,asztal kocka hatás,asztal kockaanimáció hatás,asztal rács hatás,tükrözésváltás hatás,körvonal hatás,jelenlegi ablakok hatás,ablak átméretezése hatás X-KDE-Keywords[ia]=kwin,fenestra,gerente,componente,effecto,effectos 3D,effectos 2D,OpenGL,XRender,preferentias de video,effectos graphic,effectos de scriptorio,animationes,varie animationes,effectos de gestion de genestra,effecto de commutation de fenestra, effecto de commutation de scriptorio,animationes,velocitate de animation,animationes de scriptorio,drivers, preferentias de driver,rendering,render,effecto de inverter,effecto speculo,effecto aggrandor,effecto de adjuta de photo (snap),effecto de tracia de mus,effecto zoom,effecto indistincte,effecto tabuliero,effecto explosion,effecto discolorate,effect de scriptorio discolorate,effecto de collapsar,effecto glissante, effecto de fenestra evidentiare,effecto de authenticar se,effecto de clauder session ,effecto lampada magic,minimisa effecto de animation,effecto de marca de mus,effecto de scalar,effecto de captura schermo,effecto folio,effecto diapositiva, effecto de popups glissante,effecto de miniatura de barra de carga,effecto de miniatura a parte,translucentia, effecto translucentia,transparentia, effecto de geometria de fenestra, effecto de fenestra tremulante,effecto de retro action, effecto de geniytor de dialogo, effecto inactive obscur, effecto de schermo obscur,effecto de retro glissar,eye candy,candy,monstra effecto FPS,monstra effecto pictura, effecto commuta cassa,effecto de commuta coperturat,effecto cubo de scriptorio,animation de cubo de scriptorio,effecto grillia de scriptorio,effecto flip switch,effecto contorno,effecto de fenestra actual,effect de fenestra redimensionante +X-KDE-Keywords[it]=kwin,finestra,gestore,composizione,effetto,effetti 3D,effetti 2D,OpenGL,XRender,impostazioni video,effetti grefici,effetti desktop,animazioni,animazioni varie, effetti del gestore delle finestre,effetto dello scambiafinestre, effetto dello scambiatore di desktop,animazioni,velocità animazioni,animazioni desktop,driver,impostazioni driver,disegno,rendering,effetto invertito,effetto vetro,effetto lente,effetto snap helper,effetto evidenzia mouse,effetto ingrandimento, effetto sfocatura,effetto quadro degli strumenti,effetto esplosione,effetto dissolvenza,effetto dissolvenza desktop,effetto caduta,effetto planatura,effetto evidenziazione finestra,effetto schermata di accesso, effetto disconnessione,effetto lampada magica,effetto animazione di minimizzazione,effetto tracciatura mouse, effetto scalatura,effetto istantanea,effetto foglio,effetto diapositiva,effetto scivolamento,effetto icone nella barra delle applicazioni,effetto miniatura su un lato,translucenza,effetto translucenza, trasparenza,effetto geometria finestra,effetto finestre tremolanti,effetto segnale di avvio,effetto finestra padre,effetto oscura finestra inattiva,effetto oscura schermo,effetto scivola all'indietro,gradevole,effetto gradevole,effetto mostra FPS,effetto ridisegno,effetto scambio cubi,effetto scambio copertina,effetto cubi del desktop,effetto animazione cubi del desktop,effetto griglia desktop,effetto scambiatore con inversione,effetto riquadro,effetto finestra presente,effetto ridimensionamento finestra X-KDE-Keywords[kk]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,animation speed,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,dashboard effect,explosion effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale in effect,screenshot effect,sheet effect,slide effect,sliding popups effect,taskbar thumbnails effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,box switch effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,outline effect,present windows effect,resize window effect X-KDE-Keywords[km]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,animation speed,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,dashboard effect,explosion effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale in effect,screenshot effect,sheet effect,slide effect,sliding popups effect,taskbar thumbnails effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,box switch effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,outline effect,present windows effect,resize window effect X-KDE-Keywords[nb]=kwin,vindusbehandler,sammensetting,effekt,3D-effekter,2D-effekter,OpenGL,XRender,videoinnstillinger,grafiske effekter,skrivebordseffekter,animasjoner,diverse animasjoner,vindusbytteeffekter,effekter ved skrivebordsbytte,animasjoner,animasjonsfart,skrivebordsanimasjoner,drivere,driverinnstillinger,opptegning,opptegner,inverteringseffekt,speileffekt,lupeeffekt,gripehjelpereffekt,musesporeffekt,forstørreeffekt,sløreffekt,kontrollpulteffekt,eksplosjonseffekt,uttoningseffekt,skrivebordtoningseffekt,henfallseffekt,glidereffekt,framhev vindu-effekt,innlogingseffekt,utloggingsefffekt,magisk lampe-effekt, animasjonseffekt ved vindusminimering,musmerkeeffekt,innskalerngseffekt,skjermdumpeffekt,ark-effekt,lysbildeeffekt,glidende oppspretteffekt,effekt for minibilder på oppgavelinja,effekt for minibilder på siden,gjennomskinnelighetseffekt,gjennomsiktighet,vindusgeometri-effekt,skjelvende vinduer-effekt,effekt for oppstartsmelding,effekt for foreldredialog,effekt for mørk inaktiv,effekt for mørk skjerm,gli tilbake-effekt,øyesnop,snop,vis FPS-effekt,vis malingseffekt,boksbytteeffekt,lokkbytteeffekt,skrivebordsterning-effekt,effek for animert skrivebordsterning,effekt for skrivebordsruter,effekt for flipp-bytte,omriss-effekt,effekt for vinduer tilstede,effekt for vinduer som endrer størrelse diff --git a/kcmkwin/kwindecoration/kwindecoration.desktop b/kcmkwin/kwindecoration/kwindecoration.desktop index 1d6da8f517..7adec3c557 100644 --- a/kcmkwin/kwindecoration/kwindecoration.desktop +++ b/kcmkwin/kwindecoration/kwindecoration.desktop @@ -139,7 +139,7 @@ Comment[ru]=Настройка внешнего вида заголовков о Comment[se]=Heivet lásenamahusaid fárdda Comment[si]=කවුළු ශීර්‍ෂයන්හී පෙනුම හා හැඟීම සකසන්න Comment[sk]=Nastavenie vzhľadu titulkov okien -Comment[sl]=Nastavite videz in delovanje naslovnih vrstic okna. +Comment[sl]=Nastavi videz in delovanje naslovnih vrstic okna. Comment[sr]=Подешавање изгледа и осећаја за наслове прозора Comment[sr@ijekavian]=Подешавање изгледа и осјећаја за наслове прозора Comment[sr@ijekavianlatin]=Podešavanje izgleda i osjećaja za naslove prozora diff --git a/kcmkwin/kwinoptions/focus.ui b/kcmkwin/kwinoptions/focus.ui index 1616024a22..9c27eae79c 100644 --- a/kcmkwin/kwinoptions/focus.ui +++ b/kcmkwin/kwinoptions/focus.ui @@ -56,7 +56,7 @@ - 2 + 0 diff --git a/kcmkwin/kwinoptions/kwinactions.desktop b/kcmkwin/kwinoptions/kwinactions.desktop index 2038af4760..a75df6076a 100644 --- a/kcmkwin/kwinoptions/kwinactions.desktop +++ b/kcmkwin/kwinoptions/kwinactions.desktop @@ -101,15 +101,20 @@ Name[zh_CN]=动作 Name[zh_TW]=動作 Comment=Configure mouse actions on windows +Comment[bs]=Podešavanje radnji miša pri akcijama nad prozorima Comment[ca]=Configura les accions de ratolí en les finestres Comment[cs]=Nastavení činností myši na oknech +Comment[da]=Indstilling af musehandlinger på vinduer Comment[de]=Maus-Aktionen für Fenster einrichten Comment[es]=Configurar las acciones del ratón sobre las ventanas Comment[fi]=Ikkunoiden hiiritoimintojen asetukset Comment[fr]=Configurer les actions de souris pour les fenêtres Comment[gl]=Configura a accións do rato nas xanelas +Comment[hu]=Egérműveletek beállítása az ablakokon Comment[ia]=Configura actiones de mus sur fenestras +Comment[it]=Configura le azioni del mouse sulla finestra Comment[kk]=Терезелердегі тышқанның әрекеттерін баптау +Comment[ko]=창 마우스 동작 설정 Comment[lt]=Konfigūruoti pelės veiksmus langams Comment[nb]=Sett opp musehandlingeer på vinduer Comment[nl]=Muisacties op vensters instellen @@ -118,7 +123,7 @@ Comment[pt]=Configurar as acções do rato nas janelas Comment[pt_BR]=Configura as ações do mouse nas janelas Comment[ru]=Настройка действий мыши для окон Comment[sk]=Nastaviť akcie myši na oknách -Comment[sl]=Nastavite dejanja miške na oknih +Comment[sl]=Nastavi dejanja miške na oknih Comment[sr]=Подешавање радњи миша на прозорима Comment[sr@ijekavian]=Подешавање радњи миша на прозорима Comment[sr@ijekavianlatin]=Podešavanje radnji miša na prozorima @@ -148,6 +153,7 @@ X-KDE-Keywords[ia]=tinta,maximisa,maximisa,minimisa,minimisa,plus basse,menu de X-KDE-Keywords[it]=ombra,massimizza,minimizza,abbassa,menu operazioni,barra del titolo,ridimensiona X-KDE-Keywords[kk]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize X-KDE-Keywords[km]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize +X-KDE-Keywords[ko]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,최대화,최소화,제목 표시줄,크기 조정 X-KDE-Keywords[nb]=rull,maksimer,minimer,senk,handlinger,meny,tittellinje,endre størrelse X-KDE-Keywords[nl]=verdonkeren,maximaliseren,minimaliseren,naar onderen,bedieningsmenu,titelbalk,grootte wijzigen X-KDE-Keywords[pl]=zwiń,maksymalizuj,minimalizuj,obniż,operacje na menu,pasek tytułu,zmień rozmiar diff --git a/kcmkwin/kwinoptions/kwinadvanced.desktop b/kcmkwin/kwinoptions/kwinadvanced.desktop index 5a811acaa0..7de7542cde 100644 --- a/kcmkwin/kwinoptions/kwinadvanced.desktop +++ b/kcmkwin/kwinoptions/kwinadvanced.desktop @@ -164,7 +164,7 @@ Comment[ru]=Настройка дополнительных возможност Comment[se]=Heivet viiddiduvvon lásegieđahanfunkšuvnnaid Comment[si]=උසස් කවුළු පරිපාලන විශේෂාංග සකසන්න Comment[sk]=Nastavenie pokročilých možností správy okien -Comment[sl]=Nastavitve dodatnih zmožnosti upravljanja oken +Comment[sl]=Nastavi dodatne zmožnosti upravljanja oken Comment[sr]=Подешавање напредних могућности управљања прозорима Comment[sr@ijekavian]=Подешавање напредних могућности управљања прозорима Comment[sr@ijekavianlatin]=Podešavanje naprednih mogućnosti upravljanja prozorima @@ -199,8 +199,10 @@ X-KDE-Keywords[fr]=ombres, bord, survol, bords actifs, mosaïque, onglets, tabul X-KDE-Keywords[gl]=sombra,bordo,beira,pasar,contornos activos,beiras activas,lapelas,agrupar xanelas, situación das xanelas, posicionamento das xanelas,comportamento avanzado das xanelas X-KDE-Keywords[hu]=árnyékolás,szegély,lebegés,aktív szegélyek,csempézés,bejárás,ablakbejárás,ablakcsoportosítás,ablakcsempézés,ablakelhelyezés,ablakok elhelyezése,ablak speciális viselkedése X-KDE-Keywords[ia]=umbrar,margine,planante,margines active,con tegulas,schedas,tabbing,tabbing de fenestra,gruppante fenestra,fenestra con tegulas,placiamento de fenestra,placiamento de fenestras, comportamento avantiate de fenestra +X-KDE-Keywords[it]=ombreggiatura,bordo,sovrapponi,bordi attivi,affiancatura,schede,navigazione schede,finestre a schede,regruppamento finestre,affaincatura finestre,posizionamento finestre,posizionamento delle finestre,comportamento avanzato delle finestre X-KDE-Keywords[kk]=shading,border,hover,active borders,tiling,tabs,tabbing,window tabbing,window grouping,window tiling,window placement,placement of windows,window advanced behavior X-KDE-Keywords[km]=shading,border,hover,active borders,tiling,tabs,tabbing,window tabbing,window grouping,window tiling,window placement,placement of windows,window advanced behavior +X-KDE-Keywords[ko]=shading,border,hover,active borders,tiling,tabs,tabbing,window tabbing,window grouping,window tiling,window placement,placement of windows,window advanced behavior,그림자,경계선,호버,지나다니기,타일,탭,창 탭,창 그룹,창 타일,창 위치 X-KDE-Keywords[nb]=-gardinrulling,kant,sveve,aktive kanter,flislegging,faner,vindusfaner,vindusgruppering,vindus-flislegging,vindusplassering,plassering av vinduer,avansert vindusoppførsel X-KDE-Keywords[nl]=verduisteren,rand,overzweven,actieve randen,schuin achter elkaar,tabbladen,met tabbladen werken,venstertabbladen,verstergroepering,vensters schuin achter elkaar,vensterplaatsing,plaatsing van vensters,geavanceerd gedrag van vensters X-KDE-Keywords[pl]=zwijanie,obramowanie,unoszenie,aktywne obramowania,kafelkowanie,karty,tworzenie kart, umieszczanie okien w kartach,grupowanie okien,kafelkowanie okien,umieszczanie okien, zaawansowane zachowania okien diff --git a/kcmkwin/kwinoptions/kwinfocus.desktop b/kcmkwin/kwinoptions/kwinfocus.desktop index 99ece37b9c..d5ea0bc48c 100644 --- a/kcmkwin/kwinoptions/kwinfocus.desktop +++ b/kcmkwin/kwinoptions/kwinfocus.desktop @@ -161,7 +161,7 @@ Comment[ru]=Настройка поведения фокуса окон Comment[se]=Heivet lásefohkusa doaibmanvuogi Comment[si]=කවුළෘ නාඹිගත කිරීමේ ප්‍රතිපත්ති සකසන්න Comment[sk]=Nastavenie spôsobu zamerania okien -Comment[sl]=Nastavitve ravnanja s žariščem okna +Comment[sl]=Nastavi ravnanje s žariščem okna Comment[sr]=Подешавање начина фокусирања прозора Comment[sr@ijekavian]=Подешавање начина фокусирања прозора Comment[sr@ijekavianlatin]=Podešavanje načina fokusiranja prozora @@ -196,8 +196,10 @@ X-KDE-Keywords[fr]=focus, placement, agrandissement automatique, agrandissement, X-KDE-Keywords[gl]=foco,posicionamento,erguer,teclado,CDE,alt-tab,todo o escritorio,foco segue o rato,prevención do foco,roubar o foco,política de focalización X-KDE-Keywords[hu]=fókusz,elhelyezés,automatikus felemelés,felemelés,kattintásra felemelés,billentyűzet,CDE,alt-tab,összes asztal,egérkövető fókusz,fókuszmegelőzés,fókuszlopás,fókusz házirend,ablakfókusz működése,ablakképernyő működése X-KDE-Keywords[ia]=focus,placiamento,auto raise,raise,click raise,clavierp,CDE,alt-tab,all desktop,focus seque mus,prevention de focus,focus stealing,politica de focus,comportamento de foco de fenestra,comportamento de schermo de fenestra +X-KDE-Keywords[it]=fuoco,posizionamento,avanzamento automatico,avanzamento,avanzamento con clic,tastiera,CDE,alt-tab,tutti i desktop,il fuco segue il mouse,impedisci il fuoco,mantieni il fuoco,regole fuoco,regole fuoco finestra,comportamento finestra X-KDE-Keywords[kk]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,focus follows mouse,focus prevention,focus stealing,focus policy,window focus behavior,window screen behavior X-KDE-Keywords[km]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,focus follows mouse,focus prevention,focus stealing,focus policy,window focus behavior,window screen behavior +X-KDE-Keywords[ko]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,focus follows mouse,focus prevention,focus stealing,focus policy,window focus behavior,window screen behavior,초점,위치,키보드,모든 데스크톱,초점,초점 훔치기,초점 훔치기 방지,초점 정책,창 초점 행동,창 화면 행동 X-KDE-Keywords[nb]=fokus,plassering,autohev,hev,klikk-hev,tastatur,CDE,alt-tab,alle skrivebord,fokus følger mus,fokushindring,fokus-stjeling,fokuspraksis,fokusoppførsel for vinduer,vindusoppførsel på skjerm X-KDE-Keywords[nl]=focus,plaatsing,automatisch omhoog komen,omhoog komen,omhoog komen bij klikken,toetsenbord,CDE,alt-tab,alle bureaubladen,focus volgt muis,voorkomen van focus,focus stelen,focusbeleid,focusgedrag in venster,gedrag van vensterscherm X-KDE-Keywords[pl]=uaktywnienie,umieszczenie,auto wznoszenie,wznoszenie,wznoszenie na kliknięcie,klawiatura,CDE,alt-tab,wszystkie pulpity diff --git a/kcmkwin/kwinoptions/kwinmoving.desktop b/kcmkwin/kwinoptions/kwinmoving.desktop index 243ce46864..a2a9a770c1 100644 --- a/kcmkwin/kwinoptions/kwinmoving.desktop +++ b/kcmkwin/kwinoptions/kwinmoving.desktop @@ -163,7 +163,7 @@ Comment[ru]=Настройка перемещения окон Comment[se]=Heivet mo láset lihkaduvvot Comment[si]=කවුළු ගමන්කරන ආකාරය සකසන්න Comment[sk]=Nastavenie presunu okien -Comment[sl]=Nastavitve načinov premikanja okna +Comment[sl]=Nastavi načine premikanja oken Comment[sr]=Подешавање начина на који се прозори померају Comment[sr@ijekavian]=Подешавање начина на који се прозори помијерају Comment[sr@ijekavianlatin]=Podešavanje načina na koji se prozori pomijeraju diff --git a/kcmkwin/kwinoptions/kwinoptions.desktop b/kcmkwin/kwinoptions/kwinoptions.desktop index f5488cdf30..46e17d617f 100644 --- a/kcmkwin/kwinoptions/kwinoptions.desktop +++ b/kcmkwin/kwinoptions/kwinoptions.desktop @@ -168,7 +168,7 @@ Comment[ru]=Настройка поведения окон Comment[se]=Heivet láseláhttema Comment[si]=කවුළු හැසිරීම් සකසන්න Comment[sk]=Nastavenie správania okna -Comment[sl]=Nastavite obnašanje oken +Comment[sl]=Nastavi obnašanje oken Comment[sr]=Подешавање понашања прозора Comment[sr@ijekavian]=Подешавање понашања прозора Comment[sr@ijekavianlatin]=Podešavanje ponašanja prozora diff --git a/kcmkwin/kwinrules/kwinrules.desktop b/kcmkwin/kwinrules/kwinrules.desktop index 5c29853794..fbc416e351 100644 --- a/kcmkwin/kwinrules/kwinrules.desktop +++ b/kcmkwin/kwinrules/kwinrules.desktop @@ -139,7 +139,7 @@ Comment[ru]=Настройка особых параметров для конк Comment[se]=Heivehusat erenoamáš láse várás Comment[si]=එක් කවුළුවකට විශේෂයෙන් සැකසුම් සාදන්න Comment[sk]=Nastavenie pre jednotlivé okná -Comment[sl]=Nastavite možnosti glede na posamezno okno +Comment[sl]=Nastavi možnosti glede na posamezno okno Comment[sr]=Поставке које важе посебно за сваки прозор Comment[sr@ijekavian]=Поставке које важе посебно за сваки прозор Comment[sr@ijekavianlatin]=Postavke koje važe posebno za svaki prozor diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 3a59df84e7..b30db54038 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -123,7 +123,6 @@ RulesWidget::RulesWidget(QWidget* parent) SETUP(disableglobalshortcuts, force); SETUP(blockcompositing, force); - connect (machine_match, SIGNAL(currentIndexChanged(int)), SLOT(machineMatchChanged())); connect (shortcut_edit, SIGNAL(clicked()), SLOT(shortcutEditClicked())); edit_reg_wmclass->hide(); diff --git a/kcmkwin/kwinrules/ruleswidgetbase.ui b/kcmkwin/kwinrules/ruleswidgetbase.ui index 70f568753b..a2faad9814 100644 --- a/kcmkwin/kwinrules/ruleswidgetbase.ui +++ b/kcmkwin/kwinrules/ruleswidgetbase.ui @@ -6,7 +6,7 @@ 0 0 - 630 + 486 588 @@ -2597,7 +2597,7 @@ but this may sometimes fail or superact. detectClicked() - 321 + 285 124 @@ -2613,7 +2613,7 @@ but this may sometimes fail or superact. wmclassMatchChanged() - 301 + 297 196 @@ -2629,7 +2629,7 @@ but this may sometimes fail or superact. roleMatchChanged() - 301 + 297 254 @@ -2638,5 +2638,37 @@ but this may sometimes fail or superact. + + title_match + activated(int) + KWin::RulesWidgetBase + titleMatchChanged() + + + 231 + 482 + + + 242 + 293 + + + + + machine_match + activated(int) + KWin::RulesWidgetBase + machineMatchChanged() + + + 194 + 509 + + + 242 + 293 + + + diff --git a/kcmkwin/kwinscreenedges/kwinscreenedges.desktop b/kcmkwin/kwinscreenedges/kwinscreenedges.desktop index 68d8cf38b1..e8551674b5 100644 --- a/kcmkwin/kwinscreenedges/kwinscreenedges.desktop +++ b/kcmkwin/kwinscreenedges/kwinscreenedges.desktop @@ -133,7 +133,7 @@ Comment[ro]=Configurează muchiile active ale ecranului Comment[ru]=Настройка действий для краёв экрана Comment[si]=සක්‍රිය තිර කෙලවර වින්‍යාසගත කරන්න Comment[sk]=Nastavenie aktívnych okrajov obrazovky -Comment[sl]=Nastavitve dejavnih robov zaslona +Comment[sl]=Nastavi dejavne robove zaslona Comment[sr]=Подешавање активних ивица екрана Comment[sr@ijekavian]=Подешавање активних ивица екрана Comment[sr@ijekavianlatin]=Podešavanje aktivnih ivica ekrana @@ -163,8 +163,10 @@ X-KDE-Keywords[fr]=kwin, fenêtre, gestionnaire, effet, bord, bordure, action, b X-KDE-Keywords[gl]=kwin,xanela,xestor,efecto,beira,bordo,contorno,acción,trocar,escritorio,contorno do escritorio,maximizar xanelas,escritorio virtual,esquinas da pantalla X-KDE-Keywords[hu]=kwin,ablak,kezelő,effektus,szél,szegély,művelet,váltás,asztal,kwin képernyőszél,asztalszél,képernyőszél,ablakok maximalizálása,ablakcím,képernyőoldal,képernyő működése,asztalváltás,virtuális asztal,képernyősarkok X-KDE-Keywords[ia]=kwin,fenestra,gerente,effecto,bordo,margine,action,commuta,scriptorio,bordos de schermo de kwin,bordos de scriptorio,bordos de scriptorio,maximisa fenestras,tegula fenestras,parte de schermo, comportamento de schermo,commuta scriptorio,scriptorio virtual,angulos de schermo +X-KDE-Keywords[it]=kwin,finestra,gestore,effetto,bordo,azione,scambiatore,desktop,bordi schermo kwin,bordi desktop,bordi schermo,massimizza finestre,affianca finestre,lato dello schermo,comportamento schermo,scambia desktop,desktop virtuale,angoli dello schermo X-KDE-Keywords[kk]=kwin,window,manager,effect,edge,border,action,switch,desktop,kwin screen edges,desktop edges,screen edges,maximize windows,tile windows,side of screen,screen behavior,switch desktop,virtual desktop,screen corners X-KDE-Keywords[km]=kwin,window,manager,effect,edge,border,action,switch,desktop,kwin screen edges,desktop edges,screen edges,maximize windows,tile windows,side of screen,screen behavior,switch desktop,virtual desktop,screen corners +X-KDE-Keywords[ko]=kwin,window,manager,effect,edge,border,action,switch,desktop,kwin screen edges,desktop edges,screen edges,maximize windows,tile windows,side of screen,screen behavior,switch desktop,virtual desktop,screen corners,창,관리자,효과,경계,경계선,동작,액션,전환,kwin 화면 경계,화면 경계,창 최대화,최대화,바둑판식 배열,화면 행동,데스크톱 전환,가상 데스크톱,화면 모서리 X-KDE-Keywords[nb]=kwin,vindu,behandler,effekt,kant,ramme,handling,bytte,skrivebord,kwin skjermkanter,skrivebordkanter,skjermkanter,maksimere vinduer,flislegge vinduer,skjermside,skjermoppførsel,bytte skrivebord,virtuelt skrivebord,skjermhjørner X-KDE-Keywords[nl]=kwin,venster,beheerder,effect,kant,rand,actie,omschakelen,bureaublad,schermranden van kwin,bureaubladkanten,schermkanten,vensters maximaliseren,venster schuin achter elkaar,zijkant van het scherm,schermgedrag,bureaublad omschakelen,virtueel bureaublad,schermhoeken X-KDE-Keywords[pl]=kwin,okno,menadżer,efekt,krawędź,obramowanie,działanie,przełącz,pulpit, krawędzie ekranu kwin,krawędzie pulpitu,krawędzie ekranu,maksymalizacja okien, kafelkowanie okien,strona ekranu,zachowanie ekranu,przełączanie pulpitu,wirtualny pulpit, krawędzie ekranu diff --git a/kcmkwin/kwintabbox/kwintabbox.desktop b/kcmkwin/kwintabbox/kwintabbox.desktop index 13dda2ceab..6bc547169d 100644 --- a/kcmkwin/kwintabbox/kwintabbox.desktop +++ b/kcmkwin/kwintabbox/kwintabbox.desktop @@ -111,7 +111,7 @@ Comment[pt_BR]=Configura o comportamento da navegação pelas janelas Comment[ro]=Configurează comportamentul navigării printre ferestre Comment[ru]=Настройка поведения переключателя окон Comment[sk]=Nastavenie správania pre prepínanie medzi oknami -Comment[sl]=Nastavite obnašanje pri preklapljanju med okni +Comment[sl]=Nastavi obnašanje pri preklapljanju med okni Comment[sr]=Подешавање понашања при кретању кроз прозоре Comment[sr@ijekavian]=Подешавање понашања при кретању кроз прозоре Comment[sr@ijekavianlatin]=Podešavanje ponašanja pri kretanju kroz prozore diff --git a/killwindow.cpp b/killwindow.cpp index 92481a7db8..f12cab9c92 100644 --- a/killwindow.cpp +++ b/killwindow.cpp @@ -52,7 +52,6 @@ void KillWindow::start() if (m_active) { return; } - m_active = true; xcb_connection_t *c = connection(); ScopedCPointer grabPointer(xcb_grab_pointer_reply(c, xcb_grab_pointer_unchecked(c, false, rootWindow(), @@ -64,7 +63,11 @@ void KillWindow::start() if (grabPointer.isNull() || grabPointer->status != XCB_GRAB_STATUS_SUCCESS) { return; } - grabXKeyboard(); + m_active = grabXKeyboard(); + if (!m_active) { + xcb_ungrab_pointer(connection(), XCB_TIME_CURRENT_TIME); + return; + } grabXServer(); } diff --git a/kwin.notifyrc b/kwin.notifyrc index 8e103dd7d8..ed56672f68 100644 --- a/kwin.notifyrc +++ b/kwin.notifyrc @@ -117,7 +117,7 @@ Name[ro]=Compoziționarea a fost suspendată Name[ru]=Графические эффекты были отключены Name[si]=රචනය අත්හිටුවිය Name[sk]=Kompozícia bola pozastavená -Name[sl]=Skladnja 3D je bila začasno zaustavljena +Name[sl]=Skladnja 3D je bila prestavljena v pripravljenost Name[sr]=Слагање је суспендовано Name[sr@ijekavian]=Слагање је суспендовано Name[sr@ijekavianlatin]=Slaganje je suspendovano @@ -179,7 +179,7 @@ Comment[ro]=Altă aplicație a cerut suspendarea compoziționării. Comment[ru]=Одно из приложений отключило графические эффекты Comment[si]=වෙනත් යෙදුමක් මගින් රචනය අත්හිටුවීමට ඉල්ලා ඇත. Comment[sk]=Iná aplikácia si vyžiadala pozastavenie kompozície. -Comment[sl]=Drug program je zahteval začasno zaustavitev skladnje 3D. +Comment[sl]=Drug program je zahteval prestavitev skladnje 3D v pripravljenost. Comment[sr]=Други програм је затражио да се слагање суспендује. Comment[sr@ijekavian]=Други програм је затражио да се слагање суспендује. Comment[sr@ijekavianlatin]=Drugi program je zatražio da se slaganje suspenduje. @@ -197,13 +197,19 @@ Action=Popup [Event/graphicsreset] Name=Graphics Reset +Name[bs]=Reset grafike Name[ca]=Reinici dels gràfics Name[cs]=Resetovat grafiku +Name[da]=Grafiknulstilling Name[es]=Reinicio gráfico Name[fi]=Grafiikan nollaus +Name[fr]=Réinitialisation graphique Name[gl]=Reinicio dos gráficos +Name[hu]=Grafikai visszaállítás Name[ia]=Reinitia Graphic +Name[it]=Azzeramento grafica Name[kk]=Графиканы ысыру +Name[ko]=그래픽 초기화 Name[lt]=Grafikos atstatymas Name[nl]=Grafische reset Name[pa]=ਗਰਾਫਿਕਸ ਮੁੜ-ਸੈੱਟ @@ -224,12 +230,18 @@ Name[x-test]=xxGraphics Resetxx Name[zh_CN]=图形重置 Name[zh_TW]=圖形重置 Comment=A graphics reset event occurred +Comment[bs]=Grafički reset događaj se desio Comment[ca]=Ha ocorregut un esdeveniment de reinici dels gràfics +Comment[da]=En grafiknulstillingshændelse fandt sted Comment[es]=Ha ocurrido un evento de reinicio gráfico Comment[fi]=Sattui grafiikan nollaustapahtuma +Comment[fr]=Un évènement de réinitialisation graphique est intervenu Comment[gl]=Aconteceu un reinicio de gráficos +Comment[hu]=Egy grafikai visszaállítás esemény történt Comment[ia]=Il necessita un evento de reinitiar le graphic +Comment[it]=Si è verificato un evento di azzeramento della grafica Comment[kk]=Графиканы ысыру оқиғасы болды +Comment[ko]=그래픽 초기화 이벤트가 발생함 Comment[nl]=Een gebeurtenis van een grafische reset deed zich voor Comment[pl]=Nastąpiło zdarzenie resetu grafiki Comment[pt]=Ocorreu um evento de reinício gráfico diff --git a/lanczosfilter.cpp b/lanczosfilter.cpp index 931d11f244..07eac5cc44 100644 --- a/lanczosfilter.cpp +++ b/lanczosfilter.cpp @@ -77,8 +77,8 @@ void LanczosFilter::init() // The lanczos filter is reported to be broken with the Intel driver prior SandyBridge if (gl->driver() == Driver_Intel && gl->chipClass() < SandyBridge) return; - // Broken on IvyBridge with Mesa 9.1 - BUG 313613 - if (gl->driver() == Driver_Intel && gl->chipClass() == IvyBridge && gl->mesaVersion() >= kVersionNumber(9, 1) && gl->mesaVersion() < kVersionNumber(9, 2)) + // Broken on Intel chips with Mesa 9.1 - BUG 313613 + if (gl->driver() == Driver_Intel && gl->mesaVersion() >= kVersionNumber(9, 1) && gl->mesaVersion() < kVersionNumber(9, 2)) return; // also radeon before R600 has trouble if (gl->isRadeon() && gl->chipClass() < R600) @@ -184,28 +184,14 @@ void LanczosFilter::performPaint(EffectWindowImpl* w, int mask, QRegion region, init(); const QRect screenRect = Workspace::self()->clientArea(ScreenArea, w->screen(), w->desktop()); // window geometry may not be bigger than screen geometry to fit into the FBO - if (m_shader && w->width() <= screenRect.width() && w->height() <= screenRect.height()) { - double left = 0; - double top = 0; - double right = w->width(); - double bottom = w->height(); - foreach (const WindowQuad & quad, data.quads) { - // we need this loop to include the decoration padding - left = qMin(left, quad.left()); - top = qMin(top, quad.top()); - right = qMax(right, quad.right()); - bottom = qMax(bottom, quad.bottom()); - } - double width = right - left; - double height = bottom - top; - if (width > screenRect.width() || height > screenRect.height()) { - // window with padding does not fit into the framebuffer - // so cut of the shadow - left = 0; - top = 0; - width = w->width(); - height = w->height(); - } + QRect winGeo(w->expandedGeometry()); + if (m_shader && winGeo.width() <= screenRect.width() && winGeo.height() <= screenRect.height()) { + winGeo.translate(-w->geometry().topLeft()); + double left = winGeo.left(); + double top = winGeo.top(); + double width = winGeo.right() - left; + double height = winGeo.bottom() - top; + int tx = data.xTranslation() + w->x() + left * data.xScale(); int ty = data.yTranslation() + w->y() + top * data.yScale(); int tw = width * data.xScale(); diff --git a/libkwineffects/kwinanimationeffect.cpp b/libkwineffects/kwinanimationeffect.cpp index d11d76777b..e274b33d82 100644 --- a/libkwineffects/kwinanimationeffect.cpp +++ b/libkwineffects/kwinanimationeffect.cpp @@ -284,6 +284,7 @@ void AnimationEffect::prePaintScreen( ScreenPrePaintData& data, int time ) AniData *aData = &(*anim); if (aData->attribute == KWin::AnimationEffect::CrossFadePrevious) { oldW->unreferencePreviousWindowPixmap(); + effects->addRepaint(oldW->expandedGeometry()); } animationEnded(oldW, anim->attribute, anim->meta); // NOTICE animationEnded is an external call and might have called "::animate" diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp index be7348770d..7348f65906 100644 --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -332,7 +332,7 @@ qreal WindowPaintData::crossFadeProgress() const void WindowPaintData::setCrossFadeProgress(qreal factor) { - d->crossFadeProgress = qBound(0.0, factor, 1.0); + d->crossFadeProgress = qBound(qreal(0.0), factor, qreal(1.0)); } qreal WindowPaintData::multiplyDecorationOpacity(qreal factor) diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index c7bbb391c3..14091fcc81 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -1079,6 +1079,12 @@ Q_SIGNALS: * @since 4.7 **/ void windowUnminimized(KWin::EffectWindow *w); + /** + * Signal emitted when a window either becomes modal (ie. blocking for its main client) or looses that state. + * @param w The window which was unminimized + * @since 4.11 + **/ + void windowModalityChanged(KWin::EffectWindow *w); /** * Signal emitted when an area of a window is scheduled for repainting. * Use this signal in an effect if another area needs to be synced as well. @@ -1751,7 +1757,6 @@ private: class KWIN_EXPORT WindowQuad { public: - explicit WindowQuad(); explicit WindowQuad(WindowQuadType type, int id = -1); WindowQuad makeSubQuad(double x1, double y1, double x2, double y2) const; WindowVertex& operator[](int index); @@ -1778,7 +1783,7 @@ private: }; class KWIN_EXPORT WindowQuadList - : public QVector + : public QList< WindowQuad > { public: WindowQuadList splitAtX(double x) const; @@ -2687,13 +2692,6 @@ void WindowVertex::setY(double y) WindowQuad ***************************************************************/ -inline -WindowQuad::WindowQuad() - : quadType(WindowQuadError) - , quadID(-1) -{ -} - inline WindowQuad::WindowQuad(WindowQuadType t, int id) : quadType(t) diff --git a/libkwineffects/kwinglcolorcorrection.cpp b/libkwineffects/kwinglcolorcorrection.cpp index b325b623f7..72fe2d1bc5 100644 --- a/libkwineffects/kwinglcolorcorrection.cpp +++ b/libkwineffects/kwinglcolorcorrection.cpp @@ -34,27 +34,6 @@ along with this program. If not, see . #include #include -#ifdef KWIN_HAVE_OPENGLES -#define CC_TEXTURE_INTERNAL_FORMAT GL_RGB - -/* - * A bit of ugliness to allow building with OpenGL ES < 3, without - * ifdef's everywhere in the code. These should not actually be used anywhere. - */ -#ifndef GL_TEXTURE_3D -#define GL_TEXTURE_3D 0x806F // From OES_texture_3D extension -#define GL_TEXTURE_WRAP_R 0x8072 // From OES_texture_3D extension -void glTexImage3D(GLenum, int, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *) -{ - Q_ASSERT(false); // Execution must not reach here -} -#endif // defined(GL_TEXTURE_3D) - -#else // KWIN_HAVE_OPENGLES -#define CC_TEXTURE_INTERNAL_FORMAT GL_RGB16 -#endif // KWIN_HAVE_OPENGLES - - namespace KWin { /* @@ -305,11 +284,14 @@ bool ColorCorrection::setEnabled(bool enabled) return false; } +#ifdef KWIN_HAVE_OPENGLES const GLPlatform *gl = GLPlatform::instance(); - if (enabled && gl->isGLES() && (gl->glVersion() >> 32) < 3) { - kError(1212) << "color correction is not supported with OpenGL ES < 3.0"; + if (enabled && gl->isGLES() && glTexImage3D == 0) { + kError(1212) << "color correction is not supported on OpenGL ES without OES_texture_3D"; + d->m_hasError = true; return false; } +#endif // KWIN_HAVE_OPENGLES if (enabled) { // Update all profiles and regions @@ -642,9 +624,22 @@ bool ColorCorrectionPrivate::setupCCTexture(GLuint texture, const Clut& clut) glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage3D(GL_TEXTURE_3D, 0, CC_TEXTURE_INTERNAL_FORMAT, +#ifndef KWIN_HAVE_OPENGLES + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16, LUT_GRID_POINTS, LUT_GRID_POINTS, LUT_GRID_POINTS, 0, GL_RGB, GL_UNSIGNED_SHORT, clut.data()); +#else + const int textureDataSize = clut.size(); + QVector textureData(textureDataSize); + quint8 *pTextureData = textureData.data(); + const quint16 *pClutData = clut.data(); + for (int i = 0; i < textureDataSize; ++i) + *(pTextureData++) = *(pClutData++) >> 8; + + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB, + LUT_GRID_POINTS, LUT_GRID_POINTS, LUT_GRID_POINTS, + 0, GL_RGB, GL_UNSIGNED_BYTE, textureData.data()); +#endif // KWIN_HAVE_OPENGLES return !checkGLError("setupCCTexture"); } @@ -667,7 +662,16 @@ void ColorCorrectionPrivate::colorServerUpdateSucceededSlot() // Reload all shaders ShaderManager::cleanup(); - ShaderManager::instance(); + if (!ShaderManager::instance()->isValid()) { + kError(1212) << "Shader reinitialization failed, possible compile problems with the shaders " + "altered for color-correction"; + m_hasError = true; + kDebug(1212) << "Color correction has been disabled due to shader issues"; + m_enabled = false; + GLShader::sColorCorrect = false; + ShaderManager::cleanup(); + ShaderManager::instance(); + } } emit q->changed(); diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index 8d5835ff86..0d8b5d5c0f 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -602,6 +602,7 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) } m_chipset = "Unknown"; + m_preferBufferSubData = false; // Mesa classic drivers @@ -794,8 +795,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) if (m_driver == Driver_NVidia && m_chipClass < NV40) m_supportsGLSL = false; // High likelihood of software emulation - if (m_driver == Driver_NVidia) + if (m_driver == Driver_NVidia) { m_looseBinding = true; + m_preferBufferSubData = true; + } if (m_chipClass < NV20) { m_recommendedCompositor = XRenderCompositing; @@ -1051,6 +1054,11 @@ CompositingType GLPlatform::recommendedCompositor() const return m_recommendedCompositor; } +bool GLPlatform::preferBufferSubData() const +{ + return m_preferBufferSubData; +} + bool GLPlatform::isGLES() const { #ifdef KWIN_HAVE_OPENGLES diff --git a/libkwineffects/kwinglplatform.h b/libkwineffects/kwinglplatform.h index 55e23f6545..36a0e15e16 100644 --- a/libkwineffects/kwinglplatform.h +++ b/libkwineffects/kwinglplatform.h @@ -307,6 +307,14 @@ public: **/ CompositingType recommendedCompositor() const; + /** + * Returns true if glMapBufferRange() is likely to perform worse than glBufferSubData() + * when updating an unused range of a buffer object, and false otherwise. + * + * @since 4.11 + */ + bool preferBufferSubData() const; + /** * @returns a human readable form of the @p version. * @since 4.9 @@ -359,6 +367,7 @@ private: bool m_textureNPOT: 1; bool m_limitedNPOT: 1; bool m_virtualMachine: 1; + bool m_preferBufferSubData: 1; static GLPlatform *s_platform; }; diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index 068fa53c75..6b1de3533d 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -988,7 +988,6 @@ void ShaderManager::resetShader(ShaderType type) bool GLRenderTarget::sSupported = false; bool GLRenderTarget::s_blitSupported = false; QStack GLRenderTarget::s_renderTargets = QStack(); -QSize GLRenderTarget::s_oldViewport; void GLRenderTarget::initStatic() { @@ -1013,12 +1012,6 @@ bool GLRenderTarget::blitSupported() void GLRenderTarget::pushRenderTarget(GLRenderTarget* target) { - if (s_renderTargets.isEmpty()) { - GLint params[4]; - glGetIntegerv(GL_VIEWPORT, params); - s_oldViewport = QSize(params[2], params[3]); - } - target->enable(); s_renderTargets.push(target); } @@ -1027,11 +1020,13 @@ GLRenderTarget* GLRenderTarget::popRenderTarget() { GLRenderTarget* ret = s_renderTargets.pop(); ret->disable(); + if (!s_renderTargets.isEmpty()) { s_renderTargets.top()->enable(); - } else if (!s_oldViewport.isEmpty()) { - glViewport (0, 0, s_oldViewport.width(), s_oldViewport.height()); + } else { + glViewport (0, 0, displayWidth(), displayHeight()); } + return ret; } @@ -1597,6 +1592,7 @@ public: void interleaveArrays(float *array, int dim, const float *vertices, const float *texcoords, int count); void bindArrays(); void unbindArrays(); + void reallocateBuffer(size_t size); GLvoid *mapNextFreeRange(size_t size); GLuint buffer; @@ -1731,6 +1727,17 @@ void GLVertexBufferPrivate::unbindArrays() #endif } +void GLVertexBufferPrivate::reallocateBuffer(size_t size) +{ + // Round the size up to 4 Kb for streaming/dynamic buffers. + const size_t minSize = 32768; // Minimum size for streaming buffers + const size_t alloc = usage != GL_STATIC_DRAW ? align(qMax(size, minSize), 4096) : size; + + glBufferData(GL_ARRAY_BUFFER, alloc, 0, usage); + + bufferSize = alloc; +} + GLvoid *GLVertexBufferPrivate::mapNextFreeRange(size_t size) { GLbitfield access = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT; @@ -1738,13 +1745,7 @@ GLvoid *GLVertexBufferPrivate::mapNextFreeRange(size_t size) if ((nextOffset + size) > bufferSize) { // Reallocate the data store if it's too small. if (size > bufferSize) { - // Round the size up to 4 Kb for streaming/dynamic buffers. - const size_t minSize = 32768; // Minimum size for streaming buffers - const size_t alloc = usage != GL_STATIC_DRAW ? align(qMax(size, minSize), 4096) : size; - - glBufferData(GL_ARRAY_BUFFER, alloc, 0, usage); - - bufferSize = alloc; + reallocateBuffer(size); } else { access |= GL_MAP_INVALIDATE_BUFFER_BIT; access ^= GL_MAP_UNSYNCHRONIZED_BIT; @@ -1802,7 +1803,9 @@ GLvoid *GLVertexBuffer::map(size_t size) if (GLVertexBufferPrivate::supported) glBindBuffer(GL_ARRAY_BUFFER, d->buffer); - if (GLVertexBufferPrivate::hasMapBufferRange) + bool preferBufferSubData = GLPlatform::instance()->preferBufferSubData(); + + if (GLVertexBufferPrivate::hasMapBufferRange && !preferBufferSubData) return (GLvoid *) d->mapNextFreeRange(size); // If we can't map the buffer we allocate local memory to hold the @@ -1816,26 +1819,38 @@ GLvoid *GLVertexBuffer::map(size_t size) void GLVertexBuffer::unmap() { - if (GLVertexBufferPrivate::hasMapBufferRange) { + bool preferBufferSubData = GLPlatform::instance()->preferBufferSubData(); + + if (GLVertexBufferPrivate::hasMapBufferRange && !preferBufferSubData) { glUnmapBuffer(GL_ARRAY_BUFFER); d->baseAddress = d->nextOffset; d->nextOffset += align(d->mappedSize, 16); // Align to 16 bytes for SSE - } else { - if (GLVertexBufferPrivate::supported) { - // Upload the data from local memory to the buffer object - glBufferData(GL_ARRAY_BUFFER, d->mappedSize, d->dataStore.data(), d->usage); + } else if (GLVertexBufferPrivate::supported) { + // Upload the data from local memory to the buffer object + if (preferBufferSubData) { + if ((d->nextOffset + d->mappedSize) > d->bufferSize) { + d->reallocateBuffer(d->mappedSize); + d->nextOffset = 0; + } - // Free the local memory buffer if it's unlikely to be used again - if (d->usage == GL_STATIC_DRAW) - d->dataStore = QByteArray(); + glBufferSubData(GL_ARRAY_BUFFER, d->nextOffset, d->mappedSize, d->dataStore.constData()); - d->baseAddress = 0; + d->baseAddress = d->nextOffset; + d->nextOffset += align(d->mappedSize, 16); // Align to 16 bytes for SSE } else { - // If buffer objects aren't supported we just need to update - // the client memory pointer and we're done. - d->baseAddress = intptr_t(d->dataStore.data()); + glBufferData(GL_ARRAY_BUFFER, d->mappedSize, d->dataStore.data(), d->usage); + d->baseAddress = 0; } + + // Free the local memory buffer if it's unlikely to be used again + if (d->usage == GL_STATIC_DRAW) + d->dataStore = QByteArray(); + + } else { + // If buffer objects aren't supported we just need to update + // the client memory pointer and we're done. + d->baseAddress = intptr_t(d->dataStore.data()); } d->mappedSize = 0; @@ -1898,8 +1913,6 @@ void GLVertexBuffer::draw(const QRegion ®ion, GLenum primitiveMode, int first { #ifndef KWIN_HAVE_OPENGLES if (primitiveMode == GL_QUADS) { - primitiveMode = GL_TRIANGLES; - IndexBuffer *&indexBuffer = GLVertexBufferPrivate::s_indexBuffer; if (!indexBuffer) diff --git a/libkwineffects/kwinglutils.h b/libkwineffects/kwinglutils.h index 2fdf7a1abf..20a66013b4 100644 --- a/libkwineffects/kwinglutils.h +++ b/libkwineffects/kwinglutils.h @@ -580,7 +580,6 @@ private: static bool sSupported; static bool s_blitSupported; static QStack s_renderTargets; - static QSize s_oldViewport; GLTexture mTexture; bool mValid; diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index d1c2b50e25..5576a02f9b 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -268,6 +268,9 @@ glMapBuffer_func glMapBuffer; glUnmapBuffer_func glUnmapBuffer; glGetBufferPointerv_func glGetBufferPointerv; +// GL_OES_texture_3D +glTexImage3DOES_func glTexImage3D; + // GL_EXT_map_buffer_range glMapBufferRange_func glMapBufferRange; glFlushMappedBufferRange_func glFlushMappedBufferRange; @@ -731,6 +734,12 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface) glGetBufferPointerv = NULL; } + if (hasGLExtension(QStringLiteral("GL_OES_texture_3D"))) { + glTexImage3D = (glTexImage3DOES_func)eglGetProcAddress("glTexImage3DOES"); + } else { + glTexImage3D = NULL; + } + if (hasGLExtension(QStringLiteral("GL_EXT_map_buffer_range"))) { // See http://www.khronos.org/registry/gles/extensions/EXT/EXT_map_buffer_range.txt glMapBufferRange = (glMapBufferRange_func) eglGetProcAddress("glMapBufferRangeEXT"); diff --git a/libkwineffects/kwinglutils_funcs.h b/libkwineffects/kwinglutils_funcs.h index 7e79144ae2..d2248e52c5 100644 --- a/libkwineffects/kwinglutils_funcs.h +++ b/libkwineffects/kwinglutils_funcs.h @@ -538,6 +538,8 @@ extern KWIN_EXPORT glCopyBufferSubData_func glCopyBufferSubData; #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_WRAP_R 0x8072 #endif namespace KWin @@ -570,6 +572,10 @@ extern KWIN_EXPORT glMapBuffer_func glMapBuffer; extern KWIN_EXPORT glUnmapBuffer_func glUnmapBuffer; extern KWIN_EXPORT glGetBufferPointerv_func glGetBufferPointerv; +// GL_OES_texture_3D +typedef GLvoid(*glTexImage3DOES_func)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); +extern KWIN_EXPORT glTexImage3DOES_func glTexImage3D; + // GL_EXT_map_buffer_range typedef GLvoid *(*glMapBufferRange_func)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (*glFlushMappedBufferRange_func)(GLenum target, GLintptr offset, GLsizeiptr length); diff --git a/libkwineffects/kwinxrenderutils.cpp b/libkwineffects/kwinxrenderutils.cpp index dae3d7a191..03727deb4b 100644 --- a/libkwineffects/kwinxrenderutils.cpp +++ b/libkwineffects/kwinxrenderutils.cpp @@ -109,7 +109,11 @@ static xcb_render_picture_t createPicture(xcb_pixmap_t pix, int depth) XRenderPicture::XRenderPicture(const QPixmap &pix) { - QImage img(pix.toImage()); + XRenderPicture(pix.toImage()); +} + +XRenderPicture::XRenderPicture(const QImage &img) +{ const int depth = img.depth(); xcb_pixmap_t xpix = xcb_generate_id(connection()); xcb_create_pixmap(connection(), depth, xpix, rootWindow(), img.width(), img.height()); diff --git a/libkwineffects/kwinxrenderutils.h b/libkwineffects/kwinxrenderutils.h index f2ad1c3317..a02028d766 100644 --- a/libkwineffects/kwinxrenderutils.h +++ b/libkwineffects/kwinxrenderutils.h @@ -70,6 +70,7 @@ public: explicit XRenderPicture(xcb_render_picture_t pic = XCB_RENDER_PICTURE_NONE); // TODO: Qt5 - replace QPixmap by QImage to make it more obvious that it uses PutImage explicit XRenderPicture(const QPixmap &pix); + explicit XRenderPicture(const QImage &img); XRenderPicture(xcb_pixmap_t pix, int depth); operator xcb_render_picture_t(); private: diff --git a/main.cpp b/main.cpp index 884dc151d5..0b6ff7ff23 100644 --- a/main.cpp +++ b/main.cpp @@ -476,8 +476,6 @@ KDE_EXPORT int kdemain(int argc, char * argv[]) QDBusConnection::sessionBus().interface()->registerService( appname, QDBusConnectionInterface::DontQueueService); - KCmdLineArgs* sargs = KCmdLineArgs::parsedArgs(); - return a.exec(); } diff --git a/netinfo.cpp b/netinfo.cpp index 3c01b45a5c..faf58f75fe 100644 --- a/netinfo.cpp +++ b/netinfo.cpp @@ -45,7 +45,7 @@ RootInfo *RootInfo::create() XCB_COPY_FROM_PARENT, XCB_CW_OVERRIDE_REDIRECT, values); const uint32_t lowerValues[] = { XCB_STACK_MODE_BELOW }; // See usage in layers.cpp // we need to do the lower window with a roundtrip, otherwise NETRootInfo is not functioning - QScopedPointer error(xcb_request_check(connection(), + ScopedCPointer error(xcb_request_check(connection(), xcb_configure_window_checked(connection(), supportWindow, XCB_CONFIG_WINDOW_STACK_MODE, lowerValues))); if (!error.isNull()) { kDebug(1212) << "Error occurred while lowering support window: " << error->error_code; diff --git a/nvidiahack.cpp b/nvidiahack.cpp deleted file mode 100644 index 9125968410..0000000000 --- a/nvidiahack.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2007 Lubos Lunak - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -// krazy:skip - -/* - - The only purpose of this file is to be later in the link order than - (nvidia's) libGL, thus being initialized by the dynamic linker before it, - allowing it to set __GL_YIELD=NOTHING soon enough for libGL to notice it. - -*/ - -#include - -class kwinnvidiahack -{ -public: - kwinnvidiahack(); -}; - -kwinnvidiahack::kwinnvidiahack() -{ - const char* env = getenv("KWIN_NVIDIA_HACK"); -#if 1 // turned on by default - if (env == NULL || env[ 0 ] != '0') - setenv("__GL_YIELD", "NOTHING", true); -#else // turned off by default - if (env != NULL && env[ 0 ] != '0') - setenv("__GL_YIELD", "NOTHING", true); -#endif -} - -kwinnvidiahack kwinnvidiahackinst; diff --git a/options.cpp b/options.cpp index 76ac67a8b9..4e7f28ab6c 100644 --- a/options.cpp +++ b/options.cpp @@ -649,9 +649,14 @@ void Options::setHiddenPreviews(int hiddenPreviews) void Options::setUnredirectFullscreen(bool unredirectFullscreen) { + if (GLPlatform::instance()->driver() == Driver_Intel) + unredirectFullscreen = false; // bug #252817 if (m_unredirectFullscreen == unredirectFullscreen) { return; } + if (GLPlatform::instance()->driver() == Driver_Intel) { // write back the value + KConfigGroup(KGlobal::config(), "Compositing").writeEntry("UnredirectFullscreen", false); + } m_unredirectFullscreen = unredirectFullscreen; emit unredirectFullscreenChanged(); } @@ -763,7 +768,7 @@ void Options::setGlPreferBufferSwap(char glPreferBufferSwap) // see http://www.x.org/releases/X11R7.7/doc/dri2proto/dri2proto.txt, item 2.5 if (GLPlatform::instance()->driver() == Driver_NVidia) glPreferBufferSwap = CopyFrontBuffer; - else + else if (GLPlatform::instance()->driver() != Driver_Unknown) // undetected, finally resolved when context is initialized glPreferBufferSwap = ExtendDamage; } if (m_glPreferBufferSwap == (GlSwapStrategy)glPreferBufferSwap) { diff --git a/paintredirector.cpp b/paintredirector.cpp index 7dfe7a3ed2..509bc39a2c 100644 --- a/paintredirector.cpp +++ b/paintredirector.cpp @@ -345,6 +345,13 @@ void OpenGLPaintRedirector::resizePixmaps(const QRect *rects) size[TopBottom] = QSize(align(qMax(rects[TopPixmap].width(), rects[BottomPixmap].width()), 128), rects[TopPixmap].height() + rects[BottomPixmap].height()); + if (!GLTexture::NPOTTextureSupported()) { + for (int i = 0; i < 2; i++) { + size[i].rwidth() = nearestPowerOfTwo(size[i].width()); + size[i].rheight() = nearestPowerOfTwo(size[i].height()); + } + } + bool fbo_bound = false; for (int i = 0; i < 2; i++) { diff --git a/placement.cpp b/placement.cpp index a0492afd2e..ce7e65c494 100644 --- a/placement.cpp +++ b/placement.cpp @@ -140,7 +140,7 @@ void Placement::placeAtRandom(Client* c, const QRect& area, Policy /*next*/) } // TODO: one day, there'll be C++11 ... -static inline bool isIrrelevant(Client *client, Client *regarding, int desktop) +static inline bool isIrrelevant(const Client *client, const Client *regarding, int desktop) { if (!client) return true; @@ -154,6 +154,8 @@ static inline bool isIrrelevant(Client *client, Client *regarding, int desktop) return true; if (!client->isOnCurrentActivity()) return true; + if (client->isDesktop()) + return true; return false; } @@ -808,16 +810,14 @@ void Workspace::slotWindowQuickTileBottomRight() int Workspace::packPositionLeft(const Client* cl, int oldx, bool left_edge) const { - int newx = clientArea(MovementArea, cl).left(); + int newx = clientArea(MaximizeArea, cl).left(); if (oldx <= newx) // try another Xinerama screen - newx = clientArea(MovementArea, + newx = clientArea(MaximizeArea, QPoint(cl->geometry().left() - 1, cl->geometry().center().y()), cl->desktop()).left(); if (oldx <= newx) return oldx; - for (ClientList::ConstIterator it = clients.constBegin(); - it != clients.constEnd(); - ++it) { - if (!(*it)->isShown(false) || !(*it)->isOnDesktop(active_client->desktop())) + for (ClientList::ConstIterator it = clients.constBegin(), end = clients.constEnd(); it != end; ++it) { + if (isIrrelevant(*it, cl, cl->desktop())) continue; int x = left_edge ? (*it)->geometry().right() + 1 : (*it)->geometry().left() - 1; if (x > newx && x < oldx @@ -830,16 +830,14 @@ int Workspace::packPositionLeft(const Client* cl, int oldx, bool left_edge) cons int Workspace::packPositionRight(const Client* cl, int oldx, bool right_edge) const { - int newx = clientArea(MovementArea, cl).right(); + int newx = clientArea(MaximizeArea, cl).right(); if (oldx >= newx) // try another Xinerama screen - newx = clientArea(MovementArea, + newx = clientArea(MaximizeArea, QPoint(cl->geometry().right() + 1, cl->geometry().center().y()), cl->desktop()).right(); if (oldx >= newx) return oldx; - for (ClientList::ConstIterator it = clients.constBegin(); - it != clients.constEnd(); - ++it) { - if (!(*it)->isShown(false) || !(*it)->isOnDesktop(cl->desktop())) + for (ClientList::ConstIterator it = clients.constBegin(), end = clients.constEnd(); it != end; ++it) { + if (isIrrelevant(*it, cl, cl->desktop())) continue; int x = right_edge ? (*it)->geometry().left() - 1 : (*it)->geometry().right() + 1; if (x < newx && x > oldx @@ -852,16 +850,14 @@ int Workspace::packPositionRight(const Client* cl, int oldx, bool right_edge) co int Workspace::packPositionUp(const Client* cl, int oldy, bool top_edge) const { - int newy = clientArea(MovementArea, cl).top(); + int newy = clientArea(MaximizeArea, cl).top(); if (oldy <= newy) // try another Xinerama screen - newy = clientArea(MovementArea, + newy = clientArea(MaximizeArea, QPoint(cl->geometry().center().x(), cl->geometry().top() - 1), cl->desktop()).top(); if (oldy <= newy) return oldy; - for (ClientList::ConstIterator it = clients.constBegin(); - it != clients.constEnd(); - ++it) { - if (!(*it)->isShown(false) || !(*it)->isOnDesktop(cl->desktop())) + for (ClientList::ConstIterator it = clients.constBegin(), end = clients.constEnd(); it != end; ++it) { + if (isIrrelevant(*it, cl, cl->desktop())) continue; int y = top_edge ? (*it)->geometry().bottom() + 1 : (*it)->geometry().top() - 1; if (y > newy && y < oldy @@ -874,16 +870,14 @@ int Workspace::packPositionUp(const Client* cl, int oldy, bool top_edge) const int Workspace::packPositionDown(const Client* cl, int oldy, bool bottom_edge) const { - int newy = clientArea(MovementArea, cl).bottom(); + int newy = clientArea(MaximizeArea, cl).bottom(); if (oldy >= newy) // try another Xinerama screen - newy = clientArea(MovementArea, + newy = clientArea(MaximizeArea, QPoint(cl->geometry().center().x(), cl->geometry().bottom() + 1), cl->desktop()).bottom(); if (oldy >= newy) return oldy; - for (ClientList::ConstIterator it = clients.constBegin(); - it != clients.constEnd(); - ++it) { - if (!(*it)->isShown(false) || !(*it)->isOnDesktop(cl->desktop())) + for (ClientList::ConstIterator it = clients.constBegin(), end = clients.constEnd(); it != end; ++it) { + if (isIrrelevant(*it, cl, cl->desktop())) continue; int y = bottom_edge ? (*it)->geometry().top() - 1 : (*it)->geometry().bottom() + 1; if (y < newy && y > oldy diff --git a/scene_opengl.cpp b/scene_opengl.cpp index eb5a35f1bc..c3d36bb40a 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -48,7 +48,7 @@ along with this program. If not, see . #include "screens.h" #include "workspace.h" -#include +#include #include #include @@ -1349,26 +1349,33 @@ void SceneOpenGL2Window::setupLeafNodes(LeafNode *nodes, const WindowQuadList *q getDecorationTextures(textures); nodes[LeftRightLeaf].texture = textures[0]; - nodes[LeftRightLeaf].opacity = data.opacity() * data.decorationOpacity(); + nodes[LeftRightLeaf].opacity = data.opacity(); nodes[LeftRightLeaf].hasAlpha = true; nodes[LeftRightLeaf].coordinateType = UnnormalizedCoordinates; nodes[TopBottomLeaf].texture = textures[1]; - nodes[TopBottomLeaf].opacity = data.opacity() * data.decorationOpacity(); + nodes[TopBottomLeaf].opacity = data.opacity(); nodes[TopBottomLeaf].hasAlpha = true; nodes[TopBottomLeaf].coordinateType = UnnormalizedCoordinates; } nodes[ContentLeaf].texture = s_frameTexture; nodes[ContentLeaf].hasAlpha = !isOpaque(); - nodes[ContentLeaf].opacity = data.opacity(); + // TODO: ARGB crsoofading is atm. a hack, playing on opacities for two dumb SrcOver operations + // Should be a shader + if (data.crossFadeProgress() != 1.0 && (data.opacity() < 0.95 || toplevel->hasAlpha())) { + const float opacity = 1.0 - data.crossFadeProgress(); + nodes[ContentLeaf].opacity = data.opacity() * (1 - pow(opacity, 1.0f + 2.0f * data.opacity())); + } else { + nodes[ContentLeaf].opacity = data.opacity(); + } nodes[ContentLeaf].coordinateType = UnnormalizedCoordinates; if (data.crossFadeProgress() != 1.0) { OpenGLWindowPixmap *previous = previousWindowPixmap(); nodes[PreviousContentLeaf].texture = previous ? previous->texture() : NULL; nodes[PreviousContentLeaf].hasAlpha = !isOpaque(); - nodes[PreviousContentLeaf].opacity = 1.0 - data.crossFadeProgress(); + nodes[PreviousContentLeaf].opacity = data.opacity() * (1.0 - data.crossFadeProgress()); nodes[PreviousContentLeaf].coordinateType = NormalizedCoordinates; } } @@ -1599,7 +1606,14 @@ void SceneOpenGL1Window::performPaint(int mask, QRegion region, WindowPaintData OpenGLWindowPixmap *previous = previousWindowPixmap(); const WindowQuadList contentQuads = data.quads.select(WindowQuadContents); if (previous && data.crossFadeProgress() != 1.0) { - paintContent(s_frameTexture, region, mask, data.opacity(), data, contentQuads, false); + // TODO: ARGB crsoofading is atm. a hack, playing on opacities for two dumb SrcOver operations + // Will require a caching texture or sth. else 1.2 compliant + float opacity = data.opacity(); + if (opacity < 0.95f || toplevel->hasAlpha()) { + opacity = 1 - data.crossFadeProgress(); + opacity = data.opacity() * (1 - pow(opacity, 1.0f + 2.0f * data.opacity())); + } + paintContent(s_frameTexture, region, mask, opacity, data, contentQuads, false); previous->texture()->setFilter(filter == Scene::ImageFilterGood ? GL_LINEAR : GL_NEAREST); WindowQuadList oldContents; const QRect &oldGeometry = previous->contentsRect(); @@ -1620,7 +1634,8 @@ void SceneOpenGL1Window::performPaint(int mask, QRegion region, WindowPaintData } oldContents.append(newQuad); } - paintContent(previous->texture(), region, mask, 1.0 - data.crossFadeProgress(), data, oldContents, true); + opacity = data.opacity() * (1.0 - data.crossFadeProgress()); + paintContent(previous->texture(), region, mask, opacity, data, oldContents, true); } else { paintContent(s_frameTexture, region, mask, data.opacity(), data, contentQuads, false); } @@ -1722,7 +1737,7 @@ void SceneOpenGL1Window::prepareStates(TextureType type, qreal opacity, qreal br glColor4f(opacity, opacity, opacity, opacity); tex->bind(); - if (alpha || brightness != 1.0f) { + if (alpha || !opaque || brightness != 1.0f) { glActiveTexture(GL_TEXTURE3); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); diff --git a/scene_xrender.cpp b/scene_xrender.cpp index b61bc76a28..8d38a2e2ea 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -48,6 +48,10 @@ namespace KWin xcb_render_picture_t SceneXrender::buffer = XCB_RENDER_PICTURE_NONE; ScreenPaintData SceneXrender::screen_paint; +#define DOUBLE_TO_FIXED(d) ((xcb_render_fixed_t) ((d) * 65536)) +#define FIXED_TO_DOUBLE(f) ((double) ((f) / 65536.0)) + + static xcb_render_pictformat_t findFormatForVisual(xcb_visualid_t visual) { static QHash s_cache; @@ -445,7 +449,6 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat if (toplevel->hasShadow()) transformed_shape |= toplevel->shadow()->shadowRegion(); -#define DOUBLE_TO_FIXED(d) ((xcb_render_fixed_t) ((d) * 65536)) xcb_render_transform_t xform = { DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), @@ -479,7 +482,6 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat } transformed_shape.setRects(rects.constData(), rects.count()); } -#undef DOUBLE_TO_FIXED transformed_shape.translate(mapToScreen(mask, data, QPoint(0, 0))); PaintClipper pcreg(region); // clip by the region to paint @@ -495,7 +497,8 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat // the window has border // This solves a number of glitches and on top of this // it optimizes painting quite a bit - const bool blitInTempPixmap = xRenderOffscreen() || (scaled && (wantShadow || (client && !client->noBorder()) || (deleted && !deleted->noBorder()))); + const bool blitInTempPixmap = xRenderOffscreen() || (data.crossFadeProgress() < 1.0 && !opaque) || + (scaled && (wantShadow || (client && !client->noBorder()) || (deleted && !deleted->noBorder()))); xcb_render_picture_t renderTarget = buffer; if (blitInTempPixmap) { @@ -630,7 +633,38 @@ xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, m_xrenderShadow->pic if (!opaque) { clientAlpha = xRenderBlendPicture(data.opacity()); } - xcb_render_composite(connection(), clientRenderOp, pic, clientAlpha, renderTarget, cr.x(), cr.y(), 0, 0, dr.x(), dr.y(), dr.width(), dr.height()); + xcb_render_composite(connection(), clientRenderOp, pic, clientAlpha, renderTarget, + cr.x(), cr.y(), 0, 0, dr.x(), dr.y(), dr.width(), dr.height()); + if (data.crossFadeProgress() < 1.0 && data.crossFadeProgress() > 0.0) { + XRenderWindowPixmap *previous = previousWindowPixmap(); + if (previous && previous != pixmap) { + static XRenderPicture cFadeAlpha(XCB_RENDER_PICTURE_NONE); + static xcb_render_color_t cFadeColor = {0, 0, 0, 0}; + cFadeColor.alpha = uint16_t((1.0 - data.crossFadeProgress()) * 0xffff); + if (cFadeAlpha == XCB_RENDER_PICTURE_NONE) { + cFadeAlpha = xRenderFill(cFadeColor); + } else { + xcb_rectangle_t rect = {0, 0, 1, 1}; + xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, cFadeAlpha, cFadeColor , 1, &rect); + } + if (previous->size() != pixmap->size()) { + xcb_render_transform_t xform2 = { + DOUBLE_TO_FIXED(FIXED_TO_DOUBLE(xform.matrix11) * previous->size().width() / pixmap->size().width()), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), + DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(FIXED_TO_DOUBLE(xform.matrix22) * previous->size().height() / pixmap->size().height()), DOUBLE_TO_FIXED(0), + DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1) + }; + xcb_render_set_picture_transform(connection(), previous->picture(), xform2); + } + + xcb_render_composite(connection(), opaque ? XCB_RENDER_PICT_OP_OVER : XCB_RENDER_PICT_OP_ATOP, + previous->picture(), cFadeAlpha, renderTarget, + cr.x(), cr.y(), 0, 0, dr.x(), dr.y(), dr.width(), dr.height()); + + if (previous->size() != pixmap->size()) { + xcb_render_set_picture_transform(connection(), previous->picture(), identity); + } + } + } if (!opaque) transformed_shape = QRegion(); } @@ -675,7 +709,7 @@ xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, _PART_, decorationAl if (blitInTempPixmap) { const QRect r = mapToScreen(mask, data, temp_visibleRect); xcb_render_set_picture_transform(connection(), *s_tempPicture, xform); - setPictureFilter(*s_tempPicture, KWin::Scene::ImageFilterGood); + setPictureFilter(*s_tempPicture, filter); xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, *s_tempPicture, XCB_RENDER_PICTURE_NONE, buffer, 0, 0, 0, 0, r.x(), r.y(), r.width(), r.height()); @@ -926,7 +960,7 @@ void SceneXrender::EffectFrame::renderUnstyled(xcb_render_picture_t pict, const qreal x = roundness;//we start at angle = 0 qreal y = 0; - #define DOUBLE_TO_FIXED(d) ((xcb_render_fixed_t) ((d) * 65536)) + QVector points; xcb_render_pointfix_t point; point.x = DOUBLE_TO_FIXED(roundness); @@ -944,7 +978,6 @@ void SceneXrender::EffectFrame::renderUnstyled(xcb_render_picture_t pict, const XRenderPicture fill = xRenderFill(Qt::black); xcb_render_tri_fan(connection(), XCB_RENDER_PICT_OP_OVER, fill, *s_effectFrameCircle, 0, 0, 0, points.count(), points.constData()); - #undef DOUBLE_TO_FIXED } // TODO: merge alpha mask with SceneXrender::Window::alphaMask // alpha mask @@ -1096,5 +1129,8 @@ xcb_render_picture_t SceneXRenderShadow::picture(Shadow::ShadowElements element) return *m_pictures[element]; } +#undef DOUBLE_TO_FIXED +#undef FIXED_TO_DOUBLE + } // namespace #endif diff --git a/screenedge.cpp b/screenedge.cpp index 21bafcadf5..c34d425b4a 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -47,8 +47,6 @@ along with this program. If not, see . namespace KWin { -// Reset timeout -static const int TRESHOLD_RESET = 250; // Mouse should not move more than this many pixels static const int DISTANCE_RESET = 30; @@ -133,7 +131,7 @@ void Edge::check(const QPoint &cursorPos, const QDateTime &triggerTime, bool for bool directActivate = forceNoPushBack || edges()->cursorPushBackDistance().isNull(); if (directActivate || canActivate(cursorPos, triggerTime)) { m_lastTrigger = triggerTime; - m_lastReset = triggerTime; + m_lastReset = QDateTime(); // invalidate handle(cursorPos); } else { pushCursorBack(cursorPos); @@ -143,7 +141,11 @@ void Edge::check(const QPoint &cursorPos, const QDateTime &triggerTime, bool for bool Edge::canActivate(const QPoint &cursorPos, const QDateTime &triggerTime) { - if (m_lastReset.msecsTo(triggerTime) > TRESHOLD_RESET) { + // we check whether either the timer has explicitly been invalidated (successfull trigger) or is + // bigger than the reactivation threshold (activation "aborted", usually due to moving away the cursor + // from the corner after successfull activation) + // either condition means that "this is the first event in a new attempt" + if (!m_lastReset.isValid() || m_lastReset.msecsTo(triggerTime) > edges()->reActivationThreshold()) { m_lastReset = triggerTime; return false; } diff --git a/screens.cpp b/screens.cpp index 3dd2584d79..23caf59352 100644 --- a/screens.cpp +++ b/screens.cpp @@ -37,7 +37,7 @@ Screens::Screens(QObject *parent) , m_count(0) , m_current(0) , m_currentFollowsMouse(false) - , m_changedTimer(new ScreenCountTimer(this)) + , m_changedTimer(new QTimer(this)) { m_changedTimer->setSingleShot(true); m_changedTimer->setInterval(100); @@ -117,19 +117,6 @@ int Screens::current() const return m_current; } -ScreenCountTimer::ScreenCountTimer(QObject * parent) : QTimer(parent) -{ -} - -void ScreenCountTimer::finish() -{ - if (isActive()) { - stop(); - Screens::self()->updateCount(); - QMetaObject::invokeMethod(Screens::self(), "changed", Qt::QueuedConnection); - } -} - DesktopWidgetScreens::DesktopWidgetScreens(QObject *parent) : Screens(parent) , m_desktop(QApplication::desktop()) @@ -145,13 +132,15 @@ DesktopWidgetScreens::~DesktopWidgetScreens() QRect DesktopWidgetScreens::geometry(int screen) const { - finishChangedTimer(); + if (Screens::self()->isChanging()) + const_cast(this)->updateCount(); return m_desktop->screenGeometry(screen); } int DesktopWidgetScreens::number(const QPoint &pos) const { - finishChangedTimer(); + if (Screens::self()->isChanging()) + const_cast(this)->updateCount(); return m_desktop->screenNumber(pos); } diff --git a/screens.h b/screens.h index 6bdc9689b3..f05f818519 100644 --- a/screens.h +++ b/screens.h @@ -35,15 +35,6 @@ namespace KWin { class Client; -class ScreenCountTimer : public QTimer { - public: - ScreenCountTimer(QObject * parent = 0); - /** - * if isActive, stop AND emit timeout() - */ - void finish(); -}; - class Screens : public QObject { Q_OBJECT @@ -75,6 +66,8 @@ public: virtual QRect geometry(int screen) const = 0; virtual int number(const QPoint &pos) const = 0; + inline bool isChanging() { return m_changedTimer->isActive(); } + public Q_SLOTS: void reconfigure(); @@ -85,11 +78,7 @@ Q_SIGNALS: **/ void changed(); -protected: - void finishChangedTimer() const; - protected Q_SLOTS: - friend class ScreenCountTimer; void setCount(int count); void startChangedTimer(); virtual void updateCount() = 0; @@ -98,7 +87,7 @@ private: int m_count; int m_current; bool m_currentFollowsMouse; - ScreenCountTimer *m_changedTimer; + QTimer *m_changedTimer; KSharedConfig::Ptr m_config; KWIN_SINGLETON(Screens) @@ -131,12 +120,6 @@ int Screens::count() const return m_count; } -inline -void Screens::finishChangedTimer() const -{ - const_cast(m_changedTimer)->finish(); -} - inline bool Screens::isCurrentFollowsMouse() const { diff --git a/scripting/kwinscript.desktop b/scripting/kwinscript.desktop index fa0edd7d60..795fc3bcfe 100644 --- a/scripting/kwinscript.desktop +++ b/scripting/kwinscript.desktop @@ -41,6 +41,7 @@ Comment[sr@ijekavianlatin]=KWinova skripta Comment[sr@latin]=KWinova skripta Comment[sv]=Kwin-skript Comment[tr]=KWin Betiği +Comment[ug]=KWin قوليازما Comment[uk]=Скрипт KWin Comment[vi]=Tập lệnh KWin Comment[x-test]=xxKWin Scriptxx diff --git a/tabbox/declarative.cpp b/tabbox/declarative.cpp index a7482bfae7..fc7f824a24 100644 --- a/tabbox/declarative.cpp +++ b/tabbox/declarative.cpp @@ -334,6 +334,8 @@ void DeclarativeView::currentIndexChanged(int row) void DeclarativeView::updateQmlSource(bool force) { + if (status() != Ready) + return; if (tabBox->config().tabBoxMode() != m_mode) { return; } diff --git a/tabbox/kwindesktopswitcher.desktop b/tabbox/kwindesktopswitcher.desktop index f5497d1efe..42cc455d96 100644 --- a/tabbox/kwindesktopswitcher.desktop +++ b/tabbox/kwindesktopswitcher.desktop @@ -3,13 +3,18 @@ Type=ServiceType X-KDE-ServiceType=KWin/DesktopSwitcher Comment=KWin Desktop Switcher Layout +Comment[bs]=Izgled KWin prebacivača radnih površina Comment[ca]=Disposició del commutador d'escriptoris del KWin +Comment[da]=Layout til KWins skrivebordsskifter Comment[es]=Esquema del cambiador de escritorios de KWin Comment[fi]=KWinin työpöydänvalitsimen asettelu Comment[fr]=Une disposition du sélecteur de bureaux KWin Comment[gl]=Disposición do selector de escritorios de KWin +Comment[hu]=KWin asztalváltó elrendezés Comment[ia]=Disposition de commutator de scriptorio de KWin +Comment[it]=Disposizione scambiatore desktop KWin Comment[kk]=KWin үстел ауыстырғышының қалыпы +Comment[ko]=KWin 데스크톱 전환기 레이아웃 Comment[lt]=KWin darbastalio perjungimo išdėstymas Comment[nb]=Utforming av KWin skrivebordsbytter Comment[nl]=KWin indeling van bureaubladwisselaar diff --git a/tabbox/kwinwindowswitcher.desktop b/tabbox/kwinwindowswitcher.desktop index 5d50dbdfb7..fe208d8a00 100644 --- a/tabbox/kwinwindowswitcher.desktop +++ b/tabbox/kwinwindowswitcher.desktop @@ -16,7 +16,7 @@ Comment[fr]=Disposition du sélecteur de fenêtres de KWin Comment[gl]=Disposición do alternador de xanelas de KWin Comment[hu]=KWin ablakváltó elrendezés Comment[ia]=Disposition de commutator de fenestra de KWin -Comment[it]=Layout scambiafinestre KWin +Comment[it]=Disposizione scambiafinestre KWin Comment[kk]=KWin терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​នៃ​កម្មវិធី​ប្ដូរ​បង្អួច KWin Comment[ko]=KWin 창 전환기 레이아웃 diff --git a/tabbox/qml/IconTabBox.qml b/tabbox/qml/IconTabBox.qml index fd9b752cce..c59526183c 100644 --- a/tabbox/qml/IconTabBox.qml +++ b/tabbox/qml/IconTabBox.qml @@ -29,6 +29,7 @@ Item { property alias margins: hoverItem.margins property alias currentItem: iconsListView.currentItem focus: true + clip: true function setModel(model) { @@ -92,9 +93,10 @@ Item { orientation: ListView.Horizontal // used for image provider URL to trick Qt into reloading icons when the model changes property int imageId: 0 - width: (iconSize + margins.left + margins.right) * count + width: Math.min(parent.width, (iconSize + margins.left + margins.right) * count) height: iconSize + margins.top + margins.bottom anchors { + top: parent.top horizontalCenter: parent.horizontalCenter } clip: true diff --git a/tabbox/qml/clients/big_icons/metadata.desktop b/tabbox/qml/clients/big_icons/metadata.desktop index 1202627bb1..1f612305e7 100644 --- a/tabbox/qml/clients/big_icons/metadata.desktop +++ b/tabbox/qml/clients/big_icons/metadata.desktop @@ -38,6 +38,7 @@ Name[sr@ijekavianlatin]=Velike ikone Name[sr@latin]=Velike ikone Name[sv]=Stora ikoner Name[tr]=Büyük Simgeler +Name[ug]=چوڭ سىنبەلگە Name[uk]=Великі піктограми Name[vi]=Biểu tượng lớn Name[x-test]=xxLarge Iconsxx @@ -57,7 +58,7 @@ Comment[fr]=Un sélecteur de fenêtres utilisant de grandes icônes pour représ Comment[gl]=Unha disposición do alternador de xanelas que usa iconas grandes para representar a xanela Comment[hu]=Egy ablakváltó elrendezés, amely nagy ikonokat használ az ablak ábrázolásához Comment[ia]=Un disposition de commutator de fenestra usante icones grande pro representar le fenestra -Comment[it]=Una disposizione di cambiafinestre che usa icone grandi per rappresentare le finestre +Comment[it]=Una disposizione dello scambiafinestre che usa icone grandi per rappresentare le finestre Comment[kk]=Терезелерді үлкен таңбашалармен белгілейтін терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​កម្មវិធី​ប្ដូរ​បង្អួច ដោយ​ប្រើ​រូបតំណាង​ធំ ដើម្បី​បង្ហាញ​បង្អួច​ឡើងវិញ Comment[ko]=큰 아이콘으로 창을 나타내는 창 전환기 레이아웃 diff --git a/tabbox/qml/clients/compact/metadata.desktop b/tabbox/qml/clients/compact/metadata.desktop index b2e6fd56e1..42c237312a 100644 --- a/tabbox/qml/clients/compact/metadata.desktop +++ b/tabbox/qml/clients/compact/metadata.desktop @@ -38,6 +38,7 @@ Name[sr@ijekavianlatin]=Sažeto Name[sr@latin]=Sažeto Name[sv]=Kompakt Name[tr]=Sıkışık +Name[ug]=ئىخچام Name[uk]=Компактне Name[vi]=Gọn Name[x-test]=xxCompactxx @@ -57,7 +58,7 @@ Comment[fr]=Une disposition synthétique du sélecteur de fenêtres Comment[gl]=Unha disposición compacta do alternador de xanelas Comment[hu]=Egy kompakt ablakváltó elrendezés Comment[ia]=Un disposition de commutator de fenestra compacte -Comment[it]=Una disposizione compatta di cambiafinestre +Comment[it]=Una disposizione compatta dello scambiafinestre Comment[kk]=Ықшамды терезе ауыстырғышының қалыпы Comment[km]=បង្រួម​ប្លង់​កម្មវិធី​ប្ដូរ​បង្អួច Comment[ko]=소형 창 전환기 레이아웃 diff --git a/tabbox/qml/clients/informative/metadata.desktop b/tabbox/qml/clients/informative/metadata.desktop index 1024f55b79..30bfcb154d 100644 --- a/tabbox/qml/clients/informative/metadata.desktop +++ b/tabbox/qml/clients/informative/metadata.desktop @@ -38,6 +38,7 @@ Name[sr@ijekavianlatin]=Informativno Name[sr@latin]=Informativno Name[sv]=Informativ Name[tr]=Bilgilendirici +Name[ug]=مول ئۇچۇرلۇق Name[uk]=Інформативне Name[vi]=Thông tin Name[x-test]=xxInformativexx @@ -57,7 +58,7 @@ Comment[fr]=Une disposition de sélecteur de fenêtres informative incluant le n Comment[gl]=Unha disposición informativa do alternador de xanelas que inclúe o nome do escritorio Comment[hu]=Egy informatív ablakváltó elrendezés az asztal nevét tartalmazva Comment[ia]=Un disposition de commutator de fenestra informative includente nomine de scriptorio -Comment[it]=Una disposizione informative di cambiafinestre che include il nome del desktop +Comment[it]=Una disposizione informativa dello scambiafinestre che include il nome del desktop Comment[kk]=Мәліметті терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​កម្មវិធី​ប្ដូរ​បង្អួច​ព័ត៌មាន រួមមាន​ឈ្មោះ​ផ្ទៃតុ Comment[ko]=데스크톱 이름을 포함하는 정보를 보여 주는 창 전환기 레이아웃 diff --git a/tabbox/qml/clients/present_windows/metadata.desktop b/tabbox/qml/clients/present_windows/metadata.desktop index adb2fb594b..60fa982a4a 100644 --- a/tabbox/qml/clients/present_windows/metadata.desktop +++ b/tabbox/qml/clients/present_windows/metadata.desktop @@ -39,6 +39,7 @@ Name[sr@ijekavianlatin]=Mreža Name[sr@latin]=Mreža Name[sv]=Rutnät Name[tr]=Izgara +Name[ug]=سېتكا Name[uk]=Ґратка Name[vi]=Lưới Name[x-test]=xxGridxx @@ -58,7 +59,7 @@ Comment[fr]=Une disposition de sélecteur de fenêtres affichant toutes les fen Comment[gl]=Unha disposición do alternador de xanelas que mostra nunha grella miniaturas das xanelas Comment[hu]=Egy ablakváltó elrendezés, amely az összes ablakot rácsban jeleníti meg bélyegképekként Comment[ia]=Un disposition de commutator de fenestra monstrante fenestras como miniaturas in un grillia -Comment[it]=Una disposizione di cambiafinestre che mostra tutte le finestre come miniature in una griglia +Comment[it]=Una disposizione dello scambiafinestre che mostra tutte le finestre come miniature in una griglia Comment[kk]=Бүкіл терезе нобайлары тор құрып көрсететілін терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​កម្មវិធី​ប្ដូរ​បង្អួច ដោយ​បង្ហាញ​បង្អួច​ទាំងអស់​ជា​រូបភាព​តូចៗ​ក្នុង​ក្រឡាចត្រង្គ Comment[ko]=모든 창을 바둑판식으로 미리 보여 주는 창 전환기 레이아웃 diff --git a/tabbox/qml/clients/small_icons/metadata.desktop b/tabbox/qml/clients/small_icons/metadata.desktop index 07178d2096..04ffe45a83 100644 --- a/tabbox/qml/clients/small_icons/metadata.desktop +++ b/tabbox/qml/clients/small_icons/metadata.desktop @@ -38,6 +38,7 @@ Name[sr@ijekavianlatin]=Male ikone Name[sr@latin]=Male ikone Name[sv]=Små ikoner Name[tr]=Küçük Simgeler +Name[ug]=كىچىك سىنبەلگە Name[uk]=Малі піктограми Name[x-test]=xxSmall Iconsxx Name[zh_CN]=小图标 @@ -56,7 +57,7 @@ Comment[fr]=Une disposition de sélecteur de fenêtres utilisant de petites icô Comment[gl]=Unha disposición do alternador de xanelas que usa iconas pequenas para representar a xanela Comment[hu]=Egy ablakváltó elrendezés, amely kis ikonokat használ az ablak ábrázolásához Comment[ia]=Un disposition de commutator de fenestra usante parve icones pro representar le fenestra -Comment[it]=Una disposizione di cambiafinestre che usa icone piccole per rappresentare le finestre +Comment[it]=Una disposizione dello scambiafinestre che usa icone piccole per rappresentare le finestre Comment[kk]=Терезелерді шағын таңбашалармен белгілейтін терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​កម្មវិធី​ប្ដូរ​បង្អួច ដោយ​ប្រើ​រូបតំណាង​តូច ដើម្បី​បង្ហាញ​បង្អួច​ឡើង​វិញ Comment[ko]=작은 아이콘으로 창을 나타내는 창 전환기 레이아웃 diff --git a/tabbox/qml/clients/text/metadata.desktop b/tabbox/qml/clients/text/metadata.desktop index 54c9957180..ef307c3784 100644 --- a/tabbox/qml/clients/text/metadata.desktop +++ b/tabbox/qml/clients/text/metadata.desktop @@ -27,7 +27,7 @@ Name[nl]=Tekstpictogrammen Name[pa]=ਟੈਕਸਟ ਆਈਕਾਨ Name[pl]=Ikony tekstowe Name[pt]=Ícones de Texto -Name[pt_BR]=Ícones de texto +Name[pt_BR]=Texto dos ícones Name[ro]=Pictograme textuale Name[ru]=Текстовые значки Name[sk]=Textové ikony @@ -56,7 +56,7 @@ Comment[fr]=Une disposition de sélecteur de fenêtres n'affichant que le titre Comment[gl]=Unha disposición do alternador de xanelas que só mostra os títulos das xanelas Comment[hu]=Egy ablakváltó elrendezés, amely csak az ablakfeliratokat jeleníti meg Comment[ia]=Un disposition de commutator de fenestra monstrante solo legendas de fenestra -Comment[it]=Una disposizione di cambiafinestre che mostra solo i titoli delle finestre +Comment[it]=Una disposizione dello scambiafinestre che mostra solo i titoli delle finestre Comment[kk]=Тек атауын көрсететін терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​កម្មវិធី​បង្អួច បង្ហាញ​តែ​ចំណង​ជើង​បង្អួច Comment[ko]=캡션만 보여 주는 창 전환기 diff --git a/tabbox/qml/clients/thumbnails/metadata.desktop b/tabbox/qml/clients/thumbnails/metadata.desktop index 6ea891643f..edd42606bc 100644 --- a/tabbox/qml/clients/thumbnails/metadata.desktop +++ b/tabbox/qml/clients/thumbnails/metadata.desktop @@ -37,6 +37,7 @@ Name[sr@ijekavianlatin]=Sličice Name[sr@latin]=Sličice Name[sv]=Miniatyrbilder Name[tr]=Küçük Resimler +Name[ug]=كىچىك سۈرەت Name[uk]=Мініатюри Name[x-test]=xxThumbnailsxx Name[zh_CN]=缩略图 @@ -55,7 +56,7 @@ Comment[fr]=Une disposition de sélecteur de fenêtres utilisant des aperçus en Comment[gl]=Unha disposición do alternador de xanelas que usa miniaturas ao vivo Comment[hu]=Egy ablakváltó elrendezés, amely élő bélyegképeket használ Comment[ia]=Un disposition de commutator de fenestra usante miniaturas vive -Comment[it]=Una disposizione di cambiafinestre che usa miniature dinamiche +Comment[it]=Una disposizione dello scambiafinestre che usa miniature dinamiche Comment[kk]="Тірі" нобайларын көрсететілін терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​កម្មវិធី​ប្ដូរ​បង្អួច ដោយ​ប្រើ​រូបភាព​តូចៗ​បន្ត​ផ្ទាល់ Comment[ko]=현재 상태를 보여 주는 미리 보기 그림을 사용하는 창 전환기 diff --git a/tabbox/qml/clients/window_strip/metadata.desktop b/tabbox/qml/clients/window_strip/metadata.desktop index 2b1c90e1ea..72529dbe82 100644 --- a/tabbox/qml/clients/window_strip/metadata.desktop +++ b/tabbox/qml/clients/window_strip/metadata.desktop @@ -54,7 +54,7 @@ Comment[fr]=Disposition du sélecteur de fenêtres pour Plasma Active Comment[gl]=Disposición do alternador de xanelas para Plasma Active Comment[hu]=Ablakváltó elrendezés a Plazma aktívhoz Comment[ia]=Disposition de commutator de fenestra per Plasma Active -Comment[it]=Disposizione di cambiafinestre per Plasma Active +Comment[it]=Disposizione dello scambiafinestre per Plasma Active Comment[kk]=Plasma Activt-тың терезе ауыстырғышының қалыпы Comment[km]=ប្លង់​កម្មវិធី​ប្ដូរ​បង្អួជ​សម្រាប់​ប្លាស្មា​សកម្ម Comment[ko]=Plasma Active 창 전환기 레이아웃 diff --git a/tabbox/qml/desktops/informative/metadata.desktop b/tabbox/qml/desktops/informative/metadata.desktop index a2545e77fb..cf0548b428 100644 --- a/tabbox/qml/desktops/informative/metadata.desktop +++ b/tabbox/qml/desktops/informative/metadata.desktop @@ -38,20 +38,26 @@ Name[sr@ijekavianlatin]=Informativno Name[sr@latin]=Informativno Name[sv]=Informativ Name[tr]=Bilgilendirici +Name[ug]=مول ئۇچۇرلۇق Name[uk]=Інформативне Name[vi]=Thông tin Name[x-test]=xxInformativexx Name[zh_CN]=信息 Name[zh_TW]=資訊提供 Comment=An informative desktop switcher layout +Comment[bs]=Izgled informativnog prebacivača radnih površina Comment[ca]=Una disposició informativa del commutador d'escriptoris +Comment[da]=Et informativt layout til skrivebordskift Comment[de]=Ein ausführliches Fensterwechsler-Layout Comment[es]=Un esquema informativo del cambiador de escritorios Comment[fi]=Informatiivinen työpöydänvalitsimen asettelu Comment[fr]=Une disposition du sélecteur informative de bureaux Comment[gl]=Unha disposición informativa do selector de escritorios +Comment[hu]=Egy informatív asztalváltó elrendezés Comment[ia]=Un disposition de commutator de criptorio informative +Comment[it]=Una disposizione informativa dello scambiafinestre Comment[kk]=Ақпаратты үстел ауыстырғышының қалыпы +Comment[ko]=정보가 있는 데스크톱 전환기 레이아웃 Comment[lt]=Informatyvus darbastalio perjungimo išdėstymas Comment[nb]=En kompakt utforming av skrivebordsbytter Comment[nl]=Een informatieve indeling van de bureaubladwisselaar diff --git a/tabbox/qml/desktops/previews/metadata.desktop b/tabbox/qml/desktops/previews/metadata.desktop index da166ccef8..65af2c9176 100644 --- a/tabbox/qml/desktops/previews/metadata.desktop +++ b/tabbox/qml/desktops/previews/metadata.desktop @@ -1,14 +1,19 @@ [Desktop Entry] Name=Previews +Name[bs]=Pregledi Name[ca]=Vistes prèvies Name[cs]=Náhledy +Name[da]=Forhåndsvisninger Name[de]=Vorschauen Name[es]=Vistas previas Name[fi]=Esikatselut Name[fr]=Aperçus Name[gl]=Vistas previas +Name[hu]=Előnézetek Name[ia]=Vistas preliminar +Name[it]=Anteprima Name[kk]=Алдын-ала қарау +Name[ko]=미리 보기 Name[lt]=Peržiūros Name[nb]=Forhåndsvisninger Name[nl]=Voorbeelden @@ -25,19 +30,25 @@ Name[sr@ijekavianlatin]=Pregledi Name[sr@latin]=Pregledi Name[sv]=Förhandsgranskningar Name[tr]=Önizlemeler +Name[ug]=ئالدىن كۆزەت Name[uk]=Ескізи Name[x-test]=xxPreviewsxx Name[zh_CN]=预览 Name[zh_TW]=預覽 Comment=A desktop switcher layout with previews of the desktops +Comment[bs]=Raspored preklapanja radnih površina s pregledima radnih površina Comment[ca]=Una disposició del commutador d'escriptori amb vistes prèvies dels escriptoris +Comment[da]=Et layout til skrivebordsskift med forhåndsvisning af skrivebordene Comment[de]=Ein Arbeitsflächenwechsler mit Vorschauen der Arbeitsflächen Comment[es]=Un esquema del cambiador de escritorios con vistas previas de los escritorios Comment[fi]=Työpöydänvalitsimen asettelu, jossa on esikatselut työpöydistä Comment[fr]=Une disposition de sélecteur de bureaux avec des aperçus de bureaux Comment[gl]=Unha disposición do selector de escritorios con vistas previas deles +Comment[hu]=Egy asztalváltó elrendezés az asztalok előnézetével Comment[ia]=Un disposition de commutator de scriptorio con vistas preliminar de scriptorios +Comment[it]=Una disposizione con anteprima dello scambiafinestre Comment[kk]=Үстелдер нобайларын көрсететін үстел ауыстырғышының қалыпы +Comment[ko]=데스크톱 미리 보기를 제공하는 데스크톱 전환기 레이아웃 Comment[lt]=Darbastalio perjungimo išdėstymas su darbastalių peržiūromis Comment[nb]=Utforming av KWin skrivebordsbytter med forhåndsvisning av skrivebordene Comment[nl]=Een indeling van bureaubladwisselaar met voorbeelden op de bureaubladen diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index 169c7bac37..f99bd27e1e 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -33,6 +33,7 @@ along with this program. If not, see . #include // KDE #include +#include #include namespace KWin @@ -216,19 +217,29 @@ void TabBoxHandler::show() d->lastRaisedClient = 0; d->lastRaisedClientSucc = 0; if (d->config.isShowTabBox()) { + DeclarativeView *dv(NULL); if (d->config.tabBoxMode() == TabBoxConfig::ClientTabBox) { // use declarative view if (!d->m_declarativeView) { d->m_declarativeView = new DeclarativeView(d->clientModel(), TabBoxConfig::ClientTabBox); } - d->m_declarativeView->show(); - d->m_declarativeView->setCurrentIndex(d->index, true); + dv = d->m_declarativeView; } else { if (!d->m_declarativeDesktopView) { d->m_declarativeDesktopView = new DeclarativeView(d->desktopModel(), TabBoxConfig::DesktopTabBox); } - d->m_declarativeDesktopView->show(); - d->m_declarativeDesktopView->setCurrentIndex(d->index); + dv = d->m_declarativeDesktopView; + } + if (dv->status() == QDeclarativeView::Ready && dv->rootObject()) { + dv->show(); + dv->setCurrentIndex(d->index, d->config.tabBoxMode() == TabBoxConfig::ClientTabBox); + } else { + QStringList args; + args << QStringLiteral("--passivepopup") << /*i18n*/QStringLiteral("The Window Switcher installation is broken, resources are missing.\n" + "Contact your distribution about this.") << QStringLiteral("20"); + KProcess::startDetached(QStringLiteral("kdialog"), args); + hide(); + return; } } if (d->config.isHighlightWindows()) { diff --git a/toplevel.cpp b/toplevel.cpp index 1c172211f2..cfe9e4b1e1 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -462,6 +462,7 @@ void Toplevel::elevate(bool elevate) return; } effectWindow()->elevate(elevate); + addWorkspaceRepaint(visibleRect()); } pid_t Toplevel::pid() const diff --git a/toplevel.h b/toplevel.h index af89951097..d8f1a84394 100644 --- a/toplevel.h +++ b/toplevel.h @@ -342,6 +342,7 @@ protected Q_SLOTS: void checkScreen(); void setupCheckScreenConnection(); void removeCheckScreenConnection(); + void setReadyForPainting(); protected: virtual ~Toplevel(); @@ -353,7 +354,6 @@ protected: void addDamageFull(); void getWmClientLeader(); void getWmClientMachine(); - void setReadyForPainting(); /** * @returns Whether there is a compositor and it is active. **/ diff --git a/unmanaged.cpp b/unmanaged.cpp index f782180a87..4583ce076f 100644 --- a/unmanaged.cpp +++ b/unmanaged.cpp @@ -25,6 +25,7 @@ along with this program. If not, see . #include "deleted.h" #include "xcbutils.h" +#include #include #include @@ -35,7 +36,9 @@ namespace KWin Unmanaged::Unmanaged() : Toplevel() { + ready_for_painting = false; connect(this, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), SIGNAL(geometryChanged())); + QTimer::singleShot(50, this, SLOT(setReadyForPainting())); } Unmanaged::~Unmanaged() diff --git a/workspace.cpp b/workspace.cpp index c0126411ca..844fc16428 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -179,10 +179,6 @@ Workspace::Workspace(bool restore) // start the cursor support Cursor::create(this); - // get screen support - Screens *screens = Screens::create(this); - connect(screens, SIGNAL(changed()), SLOT(desktopResized())); - #ifdef KWIN_BUILD_ACTIVITIES Activities *activities = Activities::create(this); connect(activities, SIGNAL(currentChanged(QString)), SLOT(updateCurrentActivity(QString))); @@ -190,6 +186,11 @@ Workspace::Workspace(bool restore) // PluginMgr needs access to the config file, so we need to wait for it for finishing reparseConfigFuture.waitForFinished(); + + // get screen support + Screens *screens = Screens::create(this); + connect(screens, SIGNAL(changed()), SLOT(desktopResized())); + options->loadConfig(); options->loadCompositingConfig(false); DecorationPlugin::create(this); @@ -619,10 +620,6 @@ void Workspace::removeClient(Client* c) updateStackingOrder(true); - if (m_compositor) { - m_compositor->updateCompositeBlocking(); - } - #ifdef KWIN_BUILD_TABBOX if (tabBox->isDisplayed()) tabBox->reset(true); @@ -666,6 +663,9 @@ void Workspace::removeDeleted(Deleted* c) unconstrained_stacking_order.removeAll(c); stacking_order.removeAll(c); x_stacking_dirty = true; + if (c->wasClient() && m_compositor) { + m_compositor->updateCompositeBlocking(); + } } void Workspace::updateToolWindows(bool also_hide) @@ -728,7 +728,7 @@ void Workspace::updateToolWindows(bool also_hide) for (ClientList::ConstIterator it2 = mainclients.constBegin(); it2 != mainclients.constEnd(); ++it2) { - if (c->isSpecialWindow()) + if ((*it2)->isSpecialWindow()) show = true; } if (!show) diff --git a/xcbutils.h b/xcbutils.h index 5d103995b3..fd0bfdaaae 100644 --- a/xcbutils.h +++ b/xcbutils.h @@ -32,11 +32,6 @@ along with this program. If not, see . #include #include #include -#define class class_name //HACK: work around a non-C++ safe problem in xcb_iccm.h - //where they put a variable called "class" in function signatures. - //Needed at least for xcb v0.3.8 -#include -#undef class //UNDO HACK namespace KWin { @@ -214,10 +209,15 @@ public: } }; -class TransientFor : public Wrapper +inline xcb_get_property_cookie_t get_transient_for(xcb_connection_t *c, xcb_window_t window) +{ + return xcb_get_property_unchecked(c, 0, window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 1); +} + +class TransientFor : public Wrapper { public: - explicit TransientFor(WindowId window) : Wrapper(window) {} + explicit TransientFor(WindowId window) : Wrapper(window) {} /** * @brief Fill given window pointer with the WM_TRANSIENT_FOR property of a window. @@ -228,10 +228,13 @@ public: if (isNull()) { return false; } - if (xcb_icccm_get_wm_transient_for_from_reply(prop, const_cast(data()))) { - return true; - } - return false; + + const xcb_get_property_reply_t *reply = data(); + if (!reply || reply->type != XCB_ATOM_WINDOW || reply->format != 32 || reply->length == 0) + return false; + + *prop = *reinterpret_cast(xcb_get_property_value(reply)); + return true; } }; @@ -723,6 +726,12 @@ static inline void setInputFocus(xcb_window_t window, uint8_t revertTo, xcb_time xcb_set_input_focus(connection(), revertTo, window, time); } +static inline void setTransientFor(xcb_window_t window, xcb_window_t transient_for_window) +{ + xcb_change_property(connection(), XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_TRANSIENT_FOR, + XCB_ATOM_WINDOW, 32, 1, &transient_for_window); +} + static inline void sync() { auto *c = connection();