module/foreign-toplevel: initial support

* ‘content’ is a template; the module returns a list of toplevels,
  each one instantiated using the content template.
* Each toplevel has 6 tags:
  - app-id (string)
  - title (string)
  - maximized (bool)
  - minimized (bool)
  - activated (bool)
  - fullscreen (bool)

To show the application name and title of the currently active window,
one can do:

    - foreign-toplevel:
        content:
          map:
            tag: activated
            values:
              false: {empty: {}}
              true: {string: {text: "{app-id}: {title}"}}
This commit is contained in:
Daniel Eklöf 2021-08-24 19:55:09 +02:00
parent eb94c8cceb
commit 560d7464b4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 691 additions and 0 deletions

View file

@ -52,6 +52,28 @@ if backend_wayland
mod_data += {
'river': [[wl_proto_src + wl_proto_headers + river_proto_src + river_proto_headers], [dynlist]],
}
ftop_proto_headers = []
ftop_proto_src = []
foreach prot : ['../external/wlr-foreign-toplevel-management-unstable-v1.xml']
ftop_proto_headers += custom_target(
prot.underscorify() + '-client-header',
output: '@BASENAME@.h',
input: prot,
command: [wscanner_prog, 'client-header', '@INPUT@', '@OUTPUT@'])
ftop_proto_src += custom_target(
prot.underscorify() + '-private-code',
output: '@BASENAME@.c',
input: prot,
command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@'])
endforeach
mod_data += {
'foreign-toplevel': [[ftop_proto_headers + ftop_proto_src], [dynlist]],
}
endif
foreach mod, data : mod_data