D10490: Add a method to dbus interface to query information about a window

2018-02-25 Thread Martin Flöser
This revision was automatically updated to reflect the committed changes.
Closed by commit R108:1d71292e13fc: Add a method to dbus interface to query 
information about a window (authored by graesslin).
Restricted Application edited projects, added Plasma; removed KWin.

REPOSITORY
  R108 KWin

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D10490?vs=27318=28023

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

AFFECTED FILES
  dbusinterface.cpp
  dbusinterface.h
  kcmkwin/kwinrules/CMakeLists.txt
  kcmkwin/kwinrules/detectwidget.cpp
  kcmkwin/kwinrules/detectwidget.h
  kcmkwin/kwinrules/ruleswidget.cpp
  kcmkwin/kwinrules/ruleswidget.h
  org.kde.KWin.xml

To: graesslin, #kwin, #plasma, davidedmundson, romangg
Cc: davidedmundson, broulik, plasma-devel, kwin, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, iodelay, bwowk, 
hardening


D10490: Add a method to dbus interface to query information about a window

2018-02-22 Thread David Edmundson
davidedmundson accepted this revision.
This revision is now accepted and ready to land.
Restricted Application edited projects, added Plasma; removed KWin.

REPOSITORY
  R108 KWin

BRANCH
  rules-detect-dbus

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

To: graesslin, #kwin, #plasma, davidedmundson
Cc: davidedmundson, broulik, plasma-devel, kwin, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, iodelay, bwowk, 
hardening


D10490: Add a method to dbus interface to query information about a window

2018-02-21 Thread Martin Flöser
graesslin added a comment.
Restricted Application edited projects, added KWin; removed Plasma.


  ping

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: davidedmundson, broulik, plasma-devel, kwin, iodelay, bwowk, ZrenBot, 
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart


D10490: Add a method to dbus interface to query information about a window

2018-02-20 Thread Martin Flöser
Restricted Application edited projects, added Plasma; removed KWin.

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: davidedmundson, broulik, plasma-devel, kwin, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, iodelay, bwowk, 
hardening


D10490: Add a method to dbus interface to query information about a window

2018-02-15 Thread Martin Flöser
graesslin marked an inline comment as done.
graesslin added inline comments.
Restricted Application edited projects, added KWin; removed Plasma.

INLINE COMMENTS

> davidedmundson wrote in dbusinterface.cpp:193
> can you add:
> 
> if (m_replyQuery...) {sendError()}
> 
> otherwise if a user makes two calls without selecting a window inbetween the 
> first call will just never get a response

That's already the case. If we get into this situation the underlying 
functionality returns nullptr and thus error message is send.

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: davidedmundson, broulik, plasma-devel, kwin, iodelay, bwowk, ZrenBot, 
progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, 
apol, mart


D10490: Add a method to dbus interface to query information about a window

2018-02-15 Thread Martin Flöser
graesslin updated this revision to Diff 27318.
graesslin added a comment.
Restricted Application edited projects, added Plasma; removed KWin.


  Remove unneeded comment

REPOSITORY
  R108 KWin

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D10490?vs=27094=27318

BRANCH
  rules-detect-dbus

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

AFFECTED FILES
  dbusinterface.cpp
  dbusinterface.h
  kcmkwin/kwinrules/CMakeLists.txt
  kcmkwin/kwinrules/detectwidget.cpp
  kcmkwin/kwinrules/detectwidget.h
  kcmkwin/kwinrules/ruleswidget.cpp
  kcmkwin/kwinrules/ruleswidget.h
  org.kde.KWin.xml

To: graesslin, #kwin, #plasma
Cc: davidedmundson, broulik, plasma-devel, kwin, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, iodelay, 
bwowk, hardening


D10490: Add a method to dbus interface to query information about a window

2018-02-13 Thread Martin Flöser
graesslin added inline comments.
Restricted Application edited projects, added KWin; removed Plasma.

INLINE COMMENTS

> broulik wrote in dbusinterface.cpp:199
> Can you use introspection to fill this `QVariantMap` rather than manually 
> doing this?

We don't have properties for all of them and it's currently hand picked for 
what the kcm needs.

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: davidedmundson, broulik, plasma-devel, kwin, iodelay, bwowk, ZrenBot, 
progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, 
apol, mart


D10490: Add a method to dbus interface to query information about a window

2018-02-13 Thread David Edmundson
davidedmundson added a comment.
Restricted Application edited projects, added Plasma; removed KWin.


  Cool approach. One minor thing that won't happen anyway.

INLINE COMMENTS

> dbusinterface.cpp:193
> +{
> +m_replyQueryWindowInfo = message();
> +setDelayedReply(true);

can you add:

if (m_replyQuery...) {sendError()}

otherwise if a user makes two calls without selecting a window inbetween the 
first call will just never get a response

> detectwidget.cpp:152
> +  
> QStringLiteral("queryWindowInfo"));
> +QDBusPendingReply async = 
> QDBusConnection::sessionBus().asyncCall(message);
> +

I would explicilty specify a massive timeout for anything which has user 
interaction the other side.

> ruleswidget.cpp:790
> +CHECKBOX_PREFILL(below, , info.value("keepBelow").toBool());
> +// noborder is only internal KWin information, so let's guess
> +CHECKBOX_PREFILL(noborder, , info.value("noBorder").toBool());

This isn't a guess anymore?

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: davidedmundson, broulik, plasma-devel, kwin, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, iodelay, 
bwowk, hardening


D10490: Add a method to dbus interface to query information about a window

2018-02-13 Thread Kai Uwe Broulik
broulik added inline comments.
Restricted Application edited projects, added KWin; removed Plasma.

INLINE COMMENTS

> dbusinterface.cpp:199
> +const QVariantMap ret{
> +{QStringLiteral("resourceClass"), c->resourceClass()},
> +{QStringLiteral("resourceName"), c->resourceName()},

Can you use introspection to fill this `QVariantMap` rather than manually doing 
this?

REPOSITORY
  R108 KWin

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

To: graesslin, #kwin, #plasma
Cc: broulik, plasma-devel, kwin, iodelay, bwowk, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart


D10490: Add a method to dbus interface to query information about a window

2018-02-13 Thread Martin Flöser
graesslin created this revision.
graesslin added reviewers: KWin, Plasma.
Restricted Application added a project: KWin.
Restricted Application added subscribers: kwin, plasma-devel.
graesslin requested review of this revision.
Restricted Application edited projects, added Plasma; removed KWin.

REVISION SUMMARY
  This call is added for the window rules kcm which has a detect
  functionality. As that detect functionality cannot query any Wayland
  windows we need to have some functionality in KWin core. Furthermore
  this allows to simplify the code in the kcm as all the custom X11
  interaction can be removed. KWin internally has the functionality to
  find a window at a given position.
  
  From a security perspective adding this dbus method is fine as the user
  stays in control of the functionality. It requires active click to
  select a window.
  
  The new dbus call is already used in the rules kcm replacing the
  X11 based detect functionality. That a detect is now able to get
  information for both X11 and Wayland windows. So far only X11 windows
  on X11 were supported. So this fills an important gap in the Wayland
  offerings. It should now be possible to create rules for Wayland
  windows (though may not be fully functional).

TEST PLAN
  Run the kwin_rules_dialog and it detected the window correctly

REPOSITORY
  R108 KWin

BRANCH
  rules-detect-dbus

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

AFFECTED FILES
  dbusinterface.cpp
  dbusinterface.h
  kcmkwin/kwinrules/CMakeLists.txt
  kcmkwin/kwinrules/detectwidget.cpp
  kcmkwin/kwinrules/detectwidget.h
  kcmkwin/kwinrules/ruleswidget.cpp
  kcmkwin/kwinrules/ruleswidget.h
  org.kde.KWin.xml

To: graesslin, #kwin, #plasma
Cc: plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart