Commit graph

6 commits

Author SHA1 Message Date
Daniel Eklöf
3ca274759a
module: const:ify ‘module’ argument to module->description() 2022-12-14 12:05:17 +01:00
Daniel Eklöf
515b36da0d
foreign-toplevel: refresh the bar when a top-level is closed
Fixes an issue where the last active window is still being displayed
in the bar after the corresponding top-level has been closed.

Reported here: https://github.com/johanmalm/labwc/issues/73#issuecomment-945007028
2021-10-17 09:52:28 +02:00
Daniel Eklöf
e9d762fa03
module/foreign-toplevel: disable debug logging 2021-08-27 10:14:54 +02:00
Daniel Eklöf
9681e0aabe
module/foreign-toplevel: require version 3 of wl-output interface
The bar itself already does this, and doing so means we can always use
wl_output_release() (instead of wl_output_destroy()).
2021-08-25 18:46:19 +02:00
Daniel Eklöf
589a6f528a
module/foreign-toplevel: track outputs each toplevel is mapped on
* Bind the foreign-toplevel-manager object *after* the first round of
  global objects. This ensures we bind all pre-existing wl-output
  objects before binding the toplevel manager. This is important, since
  otherwise we wont get any output_enter() events for the initial set of
  toplevels.

* Bind xdg-output-manager, to be able to bind xdg-output objects for
  each wl-output.

* Add xdg-output-listener to each wl/xdg-output, to be able to get the
  outputs’ names.

* Add a list of outputs to each toplevel. The output_enter() event
  adds to this list, and output_leave() removes from it.

* Add option ‘all-monitors’. When not set (the default), toplevels are
  only included in the generated content if they are mapped on the same
  output as the bar itself. When *not* set, all toplevels are always
  included in the generated content.
2021-08-25 18:46:19 +02:00
Daniel Eklöf
560d7464b4
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}"}}
2021-08-25 18:46:18 +02:00