D26475: [kstyle] Port to KWindowSystem shadows API

2020-01-21 Thread Vlad Zahorodnii
This revision was automatically updated to reflect the committed changes.
Closed by commit R31:7f3ae29b1964: [kstyle] Port to KWindowSystem shadows API 
(authored by zzag).

REPOSITORY
  R31 Breeze

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26475?vs=73643=74064

REVISION DETAIL
  https://phabricator.kde.org/D26475

AFFECTED FILES
  kstyle/breezeshadowhelper.cpp
  kstyle/breezeshadowhelper.h

To: zzag, #kwin, #plasma, mart
Cc: mart, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, 
fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra


D26475: [kstyle] Port to KWindowSystem shadows API

2020-01-15 Thread Vlad Zahorodnii
zzag updated this revision to Diff 73643.
zzag added a comment.


  - Drop sub-surface test
  - Don't use obsolete QWidget::isTopLevel()

REPOSITORY
  R31 Breeze

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26475?vs=73349=73643

REVISION DETAIL
  https://phabricator.kde.org/D26475

AFFECTED FILES
  kstyle/breezeshadowhelper.cpp
  kstyle/breezeshadowhelper.h

To: zzag, #kwin, #plasma, mart
Cc: mart, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, 
fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra


D26475: [kstyle] Port to KWindowSystem shadows API

2020-01-12 Thread Vlad Zahorodnii
zzag updated this revision to Diff 73349.
zzag added a comment.


  Re-write the entire port :/
  
  In case of server-side drop-shadows, we don't want to destroy KWindowShadow
  before QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed is emitted, otherwise
  the associated window will be shadow-less when it's being animated by the
  compositor.
  
  In general, we need to clean up KWindowShadow internals when QWindow sends
  QPlatformSurfaceEvent::SurfaceDestroyed or something, but unfortunately Qt
  has no such event. :(
  
  I would say that this use-case is pretty weird (I mean the intentional
  resource leak). On the other hand, having release() or something that says
  "I want to leak resource blah-blah" is also weird.
  
  It would be great to have the following event filter
  
bool ShadowHelper::eventFilter(QObject *watched, QEvent *event)
{
if (event->type() == QEvent::PlatformSurface) {
QWidget *widget = static_cast(watched);
QPlatformSurfaceEvent *surfaceEvent = 
static_cast(event);
switch (surfaceEvent->surfaceEventType()) {
case QPlatformSurfaceEvent::SurfaceCreated:
installShadows(widget);
break;
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
// Don't care.
break;
case QPlatformSurfaceEvent::SurfaceDestroyed:
uninstallShadows(widget); // will do nothing but cleanup
break;
}
}
return false;
}

REPOSITORY
  R31 Breeze

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26475?vs=72924=73349

BRANCH
  port-to-shadows-api

REVISION DETAIL
  https://phabricator.kde.org/D26475

AFFECTED FILES
  kstyle/breezeshadowhelper.cpp
  kstyle/breezeshadowhelper.h

To: zzag, #kwin, #plasma, mart
Cc: mart, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, 
fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra


D26475: [kstyle] Port to KWindowSystem shadows API

2020-01-07 Thread Marco Martin
mart accepted this revision as: Plasma, mart.
mart added a comment.
This revision is now accepted and ready to land.


  on the breeze-style side, this looks good

REPOSITORY
  R31 Breeze

REVISION DETAIL
  https://phabricator.kde.org/D26475

To: zzag, #kwin, #plasma, mart
Cc: mart, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, 
fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra


D26475: [kstyle] Port to KWindowSystem shadows API

2020-01-06 Thread Vlad Zahorodnii
zzag added a comment.


  This patch depends on D26457 .

REPOSITORY
  R31 Breeze

REVISION DETAIL
  https://phabricator.kde.org/D26475

To: zzag, #kwin, #plasma
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, 
GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D26475: [kstyle] Port to KWindowSystem shadows API

2020-01-06 Thread Vlad Zahorodnii
zzag created this revision.
zzag added reviewers: KWin, Plasma.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
zzag requested review of this revision.

REVISION SUMMARY
  The primary task of a compositor is to take a bunch of buffers from
  different clients and present them on the screen. However, the compositor
  may need to present its own stuff on the screen as well.
  
  On X11, internal clients (the ones created by KWin) are backed by real
  windows. This looks a bit clumsy since KWin uses X11 to communicate with
  itself.
  
  On Wayland, we use our own QPA that talks to KWin directly. Given that
  internal clients with the custom QPA are no longer backed by wayland
  surfaces or x11 windows, things like blur, background contrast, and
  shadows must be set through KWindowSystem APIs so KWin can catch the
  relevant API calls and handle them accordingly.
  
  The good thing is that we get rid of a good portion of platform-specific
  code. The bad thing is that we still need to be cautious about QPAs that
  destroy the underlying platform resources upon a window becoming hidden.

REPOSITORY
  R31 Breeze

REVISION DETAIL
  https://phabricator.kde.org/D26475

AFFECTED FILES
  kstyle/breezeshadowhelper.cpp
  kstyle/breezeshadowhelper.h

To: zzag, #kwin, #plasma
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, 
GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, ahiemstra, mart