0

I'm trying to expand a small utility that draws an additional stylised border around a window. I have an i3 desktop with multiple monitors each with multiple workspaces.

I can currently happily / find draw ALL windows, but I'm at a point where I need to know which windows are actually visible to the user. Don't want to draw windows on workspaces that aren't visible.

Annoyingly, Wnck does everything I need except know which workspaces are being shown. I can't find the active workspace but others are still visible on other monitors. This feels critical to knowing which windows to ignore. I can't get the list of stacked windows, which is useful, but can't think of a logic to know which monitor a given window or workspace is on to know which workspaces to pay attention to, and wnck is very but focused on simple logic about window management, rather than drawing them etc.

So GDK seems to be the other alternative from a more generic perspective but it's so much more detailed I'm struggling to see a way through what's a good approach to find what Windows are being actively drawn. As GDK has no sense of workspaces, what it's adding is offset by what Wnck can do that GDK can't. Additionally I'm not seeing how to convert windows between the two libraries, carting or using some common reference.

Any specific pointers or general suggestions about an overall approach only using gdk / gtk / wnck / Cairo (as that's what the original tool is using and I'd like to think that should be sufficient) would be ace.

Chris Phillips
  • 140
  • 1
  • 1
  • 8

0 Answers0