Commit graph

1357 commits

Author SHA1 Message Date
Flrian
8b0d5969a6 Exclude checkpatch.pl from language stats 2022-12-20 22:17:10 +00:00
Johan Malm
40302ceddd subprojects/wlroots.git: use 0.16 branch
There should be no API changes on this branch.
2022-12-20 20:48:17 +00:00
bi4k8
1b30edc778 don't set view->w and view->h when mapping xdg views
these should only be set on commit. doing so before then confuses
code that expects these fields to be in sync with the scene tree,
such as `handle_commit`.

these were only being set so that `view_center` could read them to
compute a centered position, so instead we can simply forward the
values directly to `view_compute_centered_position` and `view_move`.
2022-12-19 18:21:07 +01:00
Jan Beich
3dec9cf40c view: limit XCB header to Xwayland after 286b2146c3
../src/view.c:5:10: fatal error: 'xcb/xcb_icccm.h' file not found
 #include <xcb/xcb_icccm.h>
          ^~~~~~~~~~~~~~~~~
2022-12-19 13:12:41 +01:00
Flrian
5dba59f87a README.md: fix header numbering 2022-12-15 12:51:53 +01:00
bi4k8
ab74d726c6 osd: bookend with calls to cursor_update_focus
this updates the cursor if it is within the OSD area when OSD appears
or disappears
2022-12-14 12:29:16 +01:00
bi4k8
4f0b72c341 osd: factor drawing out of osd_update 2022-12-13 21:41:41 +01:00
Consolatis
8032769197 docs/menu.xml: Add comment about hiding of workspaces menu 2022-12-12 17:56:36 +00:00
Consolatis
a5caccb82a docs/rc.xml.all: Add <default /> description for mousebinds 2022-12-12 17:56:36 +00:00
Consolatis
13710d1ef6 docs/rc.xml: add default mousebind example 2022-12-12 17:56:36 +00:00
Consolatis
5687ac7e35 docs: reformat rc.xml.all 2022-12-12 17:56:36 +00:00
Consolatis
95b21bef01 docs: reformat default config 2022-12-12 17:56:36 +00:00
Flrian
e4aa7cef76 src/view.c: dont switch output on SnapToEdge if view is maximized 2022-12-10 23:55:49 +01:00
Consolatis
7cc80b7a99 src/action.c: Provide generic parsing of XML action arguments
.. and use it within src/config/rcxml.c and src/menu/menu.c.

This fixes being unable to use the `direction` argument in menu entries.

Reported-by: mahk via IRC
2022-12-10 19:55:53 +00:00
bi4k8
7ad5490ff0 document Kill command 2022-12-08 19:33:09 +00:00
bi4k8
52738eedcf implement Kill action
this action sends SIGTERM to a client's process
2022-12-08 19:33:09 +00:00
bi4k8
39bea30cd5 don't NULL-check output when it can't be
`output` here is the `pos` argument of `wl_list_for_each`, which means
it is always assigned a return value of `wl_container_of`; this in
turn means that it is never NULL.

checking against NULL here just confuses static analysis and readers
2022-12-08 19:24:02 +00:00
bi4k8
272221dae2 fix cleanup issues in xdg_surface_new
`view->surface` had not been set to a non-`NULL` value here, so it
was not yet appropriate to access its `resource` member. instead,
use the resource from the argument xdg_surface.

furthermore, we need to free the newly-allocated `xdg_toplevel_view`
before error return.
2022-12-08 19:24:02 +00:00
Johan Malm
1ebf5bce90 README.md: update build instructions
...because running the setup command as `meson [options]` instead of
`meson setup [options]` is ambiguous and deprecated.
2022-12-07 15:20:10 +01:00
Consolatis
d00327bc32 menu: Dynamically adjust menu width based on widest item
Adds two new theme vars:
- menu.width.min (menu will never be smaller than this)
- menu.width.max (menu will never be wider than this + padding)

A fixed menu width can be achieved by setting
menu.width.min == menu.width.max.
2022-12-06 21:08:43 +00:00
Consolatis
f0666ba5c9 menu: Convert hardcoded item padding to theme vars
Adds two new theme vars:
- menu.items.padding.x
- menu.items.padding.y
2022-12-06 21:08:43 +00:00
Consolatis
3da7cfd8c6 theme: Rename separator_width to separator_line_thickness 2022-12-06 21:08:43 +00:00
Consolatis
ccf68c5950 menu: Add generic menu_init() entry point 2022-12-06 21:08:43 +00:00
Johan Malm
aa4ef94af0 README: restructure and amend project description
- Describe why the projects exists and state some core-dev values
- Merge the two scope sections
- Put video links before screenshot
2022-12-01 19:10:39 +00:00
Johan Malm
05484820e6 CONTRIBUTING.md: describe how to upversion
...and also split 'Debugging' into sub-sections
2022-11-29 19:46:37 +00:00
Johan Malm
2afab5c694 labwc-menu(5): document separator 2022-11-29 19:45:57 +01:00
Consolatis
d616d719eb CI: check codestyle only once 2022-11-28 16:50:50 +01:00
Consolatis
e95779540c docs: add basic README 2022-11-28 12:09:24 +01:00
Consolatis
b839bbe0a9 docs: install example configs 2022-11-28 12:09:24 +01:00
John Lindgren
b67eccc99a ssd: Move implementation details from ssd.h to ssd-internal.h
- Move private structs and functions to `ssd-internal.h`
- Add `ssd_button_get_type()` and `ssd_button_get_view()`
2022-11-27 15:09:45 +00:00
John Lindgren
1e8b0414fe ssd: Allocate struct ssd and struct ssd_hover_state separately
- 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
2022-11-27 06:48:41 +00:00
John Lindgren
cfa51ab628 view: Fix SSD margin computation
If `view->ssd_enabled` is false when calling `ssd_create()` then
`ssd_thickness()` returns zeroes which are stored in `ssd->margins`.

The quick fix is just to ensure we set `view->ssd_enabled` before
calling `ssd_create()`. At some point, it might be nice to refactor
so that `ssd_create()` does not reference `view->ssd_enabled`.
2022-11-27 06:47:56 +00:00
Johan Malm
b203758ce1 Fix minor coding style breaches 2022-11-27 04:03:21 +01:00
Johan Malm
dca21fd087 ci: run checkpatch.pl on all .c and .h files 2022-11-27 04:03:21 +01:00
John Lindgren
74fb769758 ssd: Add debug helpers 2022-11-26 21:24:46 +00:00
John Lindgren
957d9e5926 ssd: Cosmetic cleanups
- 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.
2022-11-26 21:24:46 +00:00
John Lindgren
9dd55f0490 view: Hide decorations for fullscreen views
Otherwise the decorations are visible on adjacent outputs.
2022-11-26 18:02:24 +00:00
John Lindgren
d6aea3e58f ssd: Add missing state updates
- 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
2022-11-26 18:02:24 +00:00
John Lindgren
cb16da5a78 ssd: Eliminate unnecessary temporary variables 2022-11-26 18:02:24 +00:00
John Lindgren
4e7891eb8d ssd: Simplify ssd_create()
- Add `active` argument for consistency with `ssd_set_active()`
- `assert()` that `ssd_create()` is not called twice without an
  `ssd_destroy()` in between
2022-11-26 18:02:24 +00:00
John Lindgren
ac9228e7f8 view: Add view_reload_ssd()
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.
2022-11-26 18:02:24 +00:00
John Lindgren
b150e11cd3 view: Enable/disable decorations explicitly
`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.
2022-11-26 18:02:24 +00:00
John Lindgren
4906d1833a action: Inline private/action.h into action.c
There is no need for a header since the types defined in it are
used only in action.c.
2022-11-25 22:32:22 +00:00
John Lindgren
4da37c6532 view: Move xdg_surface + xwayland_surface to derived structs
Add xdg_surface_from_view() + xwayland_surface_from_view() accessors
that assert() the view is of the expected type before returning.

Fix a real bug in xdg.c parent_of() that dereferenced
`view->xdg_surface->toplevel` without first checking `view->type`.

The goal of the new accessors is to catch similar bugs in future.
2022-11-25 22:21:17 +00:00
Johan Malm
df7276345f view: create derived structs
...for XDG toplevels and XWayland views to only include applicable
wl_listeners for each type of view.
2022-11-25 14:47:53 +00:00
John Lindgren
56f8837ca6 view/ssd: Move ssd->enabled to view->ssd_enabled 2022-11-22 09:17:33 +01:00
John Lindgren
c536ee9d96 view/ssd: Move view->margin to view->ssd.margin 2022-11-22 09:17:33 +01:00
John Lindgren
e79c95489a view: Add view_set_untiled() 2022-11-22 09:17:33 +01:00
John Lindgren
c67c6691ac view: Rename/move workspaces_send_to() to view_move_to_workspace()
This function semantically belongs in view.c since it
modifies `struct view`.

Also a minor formatting fix in view_toggle_always_on_top().
2022-11-22 09:17:33 +01:00
John Lindgren
0e6d99e0ca action/view: Ensure view arguments are never NULL 2022-11-22 09:17:33 +01:00