D20051: Do not try to set shadows for panels if theme does not provide elements

2019-04-01 Thread Friedrich W. H. Kossebau
This revision was automatically updated to reflect the committed changes.
Closed by commit R120:2a63696f57f4: Do not try to set shadows for panels if 
theme does not provide elements (authored by kossebau).

REPOSITORY
  R120 Plasma Workspace

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D20051?vs=54820=55193

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

AFFECTED FILES
  shell/panelshadows.cpp
  shell/panelshadows_p.h

To: kossebau, #plasma, mart
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart


D20051: Do not try to set shadows for panels if theme does not provide elements

2019-03-25 Thread Friedrich W. H. Kossebau
kossebau created this revision.
kossebau added reviewers: Plasma, mart.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
kossebau requested review of this revision.

REVISION SUMMARY
  Older Plasma themes, which are still offered also for current Plasma 5 e.g.
  from store.kde.org, are missing out "shadow-*" elements for
  "widgets/panel-background". The old code of the PanelShadows class does not
  handle that case though, and as result for X11 sets a _KDE_NET_WM_SHADOW
  property with "0" for most of the pixmaps due to them being an empty pixmap
  in at least one dimension (except for the emtpy corner pixmap which is
  always 1,1). The resulting behaviour with current KWin (X11) is this:
  
  - when starting a Plasma shell with a theme without panel shadow elements, 
KWin does not show shadows
  - when switching from a theme with shadow elements to one without, the shadow 
of the previous theme is continued to be used.
  
  Reason is that KWin when parsing that property cancels the parsing when it
  comes across a "0"/null id for a shadow pixmap, without further error
  handling, so either does not create a shadow or keeps the old.
  
  This patch catches the case of themes without any panel shadow elements and
  only sets the _KDE_NET_WM_SHADOW property or wayland shadow if there are
  shadows, otherwise removes them if needed.

TEST PLAN
  Switch between Plasma themes with and without separate shadow elements
  defined (e.g. Breeze <-> Fluffy Bunny).

REPOSITORY
  R120 Plasma Workspace

BRANCH
  unsetshadowforpanelifnone

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

AFFECTED FILES
  shell/panelshadows.cpp
  shell/panelshadows_p.h

To: kossebau, #plasma, mart
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart