wlr_output_layout_get() returns NULL for disabled outputs.
Backtrace (abbreviated):
#0 lab_wlr_output_layout_layout_coords at ../src/ssd/ssd_extents.c:33
#1 ssd_extents_update at ../src/ssd/ssd_extents.c:133
#2 ssd_extents_create at ../src/ssd/ssd_extents.c:95
#3 ssd_create at ../src/ssd/ssd.c:161
#4 decorate.part.0.lto_priv.0 at ../src/view.c:637
#5 decorate at ../src/view.c:636
#6 view_set_fullscreen at ../src/view.c:716
#7 view_adjust_for_layout_change ../src/view.c:745
#8 desktop_arrange_all_views ../src/desktop.c:52
#9 output_update_all_usable_areas at ../src/output.c:495
#10 output_update_for_layout_change at ../src/output.c:263
#11 do_output_layout_change at ../src/output.c:423
#12 do_output_layout_change at ../src/cursor.c:267
#13 output_config_apply at ../src/output.c:334
#14 handle_output_manager_apply at ../src/output.c:354
This allows using large XBM button icons (larger than
the button width / height) for high and mixed DPI usecases.
Instead of scaling up the low pixel icons when moving a window to a
high DPI output we scale the icons down when moving to a non-scaled
output. The user is still responsible to create / use larger XBM
icons for their theme.
Partly fixes#609
- Store a pointer to the `struct view` in `struct ssd`
- Pass `struct ssd *` instead of `struct view *` to ssd functions
- Add `ssd_get_margin()` convenience function
- Minimize includes in `ssd.h`
- Avoid repetitive `view->ssd.margin` pattern
- Use `struct ssd *` or `const struct ssd *` rather than `struct view *`
where convenient
Part of the motivation is to make it easier to separate `struct ssd`
from `struct view` in a future commit.
- Update `ssd.state` in `ssd_create()` to avoid doing unnecessary work in
the next call to `ssd_update_geometry()`
- Reset `ssd.margin` in `ssd_destroy()` to avoid accidentally using stale
values
- Add `active` argument for consistency with `ssd_set_active()`
- `assert()` that `ssd_create()` is not called twice without an
`ssd_destroy()` in between
Gather related logic from `reload_config_and_theme()` in `server.c` and
`ssd_reload()` in `ssd.c` into a new function, `view_reload_ssd()`.
Also drop the `view->mapped` check since we want to update any view that
has SSD nodes created, mapped or not.
`view_set_decorations()` now calls `ssd_create()` and `ssd_destroy()`
explicitly to enable/disable decorations. As a result, the implicit
enable/disable logic in `ssd_update_geometry()` is no longer needed.
I was making a theme and discovered only the active window button icon
color was taking effect. The pixmaps were being created in both the
active and inactive cases, but inactive pixmaps were never added to
the SSD scene graph.
IMHO it encourages better design (by making dependencies more obvious)
to have source file/header file pairs like view.c/view.h, rather than a
monolithic header like labwc.h with everything in it.
I don't think we need to break up all of labwc.h at once, but maybe we
can start pulling it apart bit by bit as it's convenient.
Also:
- Move "struct border" to ssd.h so that view.h can use it without pulling
in all of labwc.h.
- Add a missing required #include within scaled_font_buffer.h (forward
declaration of "struct font" is not enough).
map() in xwayland.c called ssd_create() but did not call
view_apply_maximized_geometry() afterward, resulting in the
decorations being displayed off-screen.
Rather than calling view_apply_maximized_geometry() in more places,
let's reuse the existing call in view_set_decorations(), and extend
ssd_update_geometry() to call ssd_create() when needed.
Corner buttons (WINDOW_MENU and CLOSE) are one more level down in
the scene-tree (see add_scene_button_corner() in ssd_part.c).
This fixes a minor issue where, when right-clicking on the CLOSE
button, the client-menu would be displayed in the wrong location.
... and use Title for the Drag (Move) and DoubleClick (Maximize)
titlebar actions, which are unexpected when the cursor is over one
of the window buttons.
Before this commit the window title could overflow in certain conditions,
usually when rapidly resizing. This commit fixes it by completely hiding
the corresponding scene node when there is no space available.
Reported-by: <peperino> via IRC
This matches the behavior of the surrounding borders and will usually
cause resizing instead of triggering the button itself. This effect
is only really visible when using a border width settings of > 1.
Fixes#379
As it turns out the reason for the workaround was a bug
in wlroots which got fixed in the meantime.
So to keep things simple just revert the workaround and
depend on the wlroots fix instead.
To update the wlroots subproject use
meson subprojects update wlroots
This reverts commit e87aa19066.
wlr_scene_buffers need an additional wlr_scene_buffer_set_source_box()
to be scaled correctly by wlroots based on the output scale.
With this commit the buffers are now scaled correctly but, especially
on higher scale factors, may be a bit blurry.
In the future we likely want a dynamic font label generator based
on the maximal scale of all the outputs the specific buffer is currently on.
Some inspiration for that could be
https://github.com/Nefsen402/sway/blob/scene-graph/sway/sway_text_buffer.cFixes#348