[Question-KWin] - Find window's screen through WId?

Eike Hein hein at kde.org
Wed Nov 23 00:22:04 UTC 2016



On 11/23/2016 06:06 AM, Michail Vourlakos wrote:
> 
> On 22/11/2016 10:13 μμ, David Edmundson wrote:
>> For your own window? A window that you're getting from TasksModel or
>> something else?
> 
> not my window, for a window that you know only its  WId that has been
> returned somehow from KWIn

Look at how libtaskmanger does it in XWindowsTasksModel. Basically
get the window's frameGeometry from KWindowInfo (via WId), then
correlate with screen geometry from QScreen. The latter is done via
calculating the closest-in-distance screen with a fallback, because
depending on the screen setup, a window can actually be in dead
space between screens coordinate-wise.

Cheers,
Eike


More information about the Plasma-devel mailing list