]> git.mdlowis.com Git - proto/labwc.git/commit
foreign-toplevel: simplify and fully separate ext-foreign/wlr-foreign
authorJohn Lindgren <john@jlindgren.net>
Fri, 8 Aug 2025 00:30:59 +0000 (20:30 -0400)
committerJohn Lindgren <john@jlindgren.net>
Fri, 8 Aug 2025 03:27:04 +0000 (23:27 -0400)
commit02df0a15d714dc47934a0c6ba4ba57e3f841daa5
tree6ee2b24442293a6c52ff2e7eb3f607f55cb9eff9
parent55b495f3981aab0b0af825cca594324a2f24fbb2
foreign-toplevel: simplify and fully separate ext-foreign/wlr-foreign

Currently, the dependencies between foreign-toplevel[-internal],
ext-foreign, and wlr-foreign are cyclical and a bit complex.

I suggest we reorganize it into a simpler hierarchy:

  foreign-toplevel/
    -> foreign.c/h
      -> (depends on) ext-foreign.c/h
      -> (depends on) wlr-foreign.c/h

The refactored code is smaller and (IMO) easier to follow.

In detail:

- Add include/foreign-toplevel folder mirroring src/foreign-toplevel
- Split foreign-toplevel-internal.h to ext-foreign.h and wlr-foreign.h
- Eliminate ext-/wlr-foreign.c -> foreign.c reverse dependencies
  (including internal signals and foreign_request* functions)
- Make struct foreign_toplevel private to foreign.c

Lightly tested with qmpanel (which uses wlr-foreign-toplevel).

v2: reorder foreign-toplevel internal API funcs
include/foreign-toplevel-internal.h [deleted file]
include/foreign-toplevel/ext-foreign.h [new file with mode: 0644]
include/foreign-toplevel/foreign.h [moved from include/foreign-toplevel.h with 100% similarity]
include/foreign-toplevel/wlr-foreign.h [new file with mode: 0644]
src/foreign-toplevel/ext-foreign.c
src/foreign-toplevel/foreign.c
src/foreign-toplevel/wlr-foreign.c
src/view-impl-common.c
src/view.c
src/xdg.c
src/xwayland.c