Commit graph

86 commits

Author SHA1 Message Date
John Lindgren
a54d378e6c common: Add znew/znew_n() macros 2022-09-18 15:25:19 -04:00
John Lindgren
cb40cdc36c common: Add additional memory utilities (xzalloc() etc.) 2022-09-17 10:57:30 -04:00
Consolatis
e30fce6c34 cursor: Use enum for server set cursor names
This mainly prevents having to use strcmp() on every mouse move.
2022-09-16 21:30:40 +01:00
John Lindgren
07a83c19f0 config: Add support for font slant and weight 2022-09-15 21:48:05 +01:00
John Lindgren
48fde32e62 ssd: Make ssd_get_part_type() work for corner buttons
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.
2022-09-09 15:23:13 -04:00
John Lindgren
ebd0a5d526 config: Redefine Title context to include blank areas of Titlebar
... 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.
2022-09-09 15:23:13 -04:00
John Lindgren
b7c4ba825a view/ssd: Refactor and fix visual indication for active windows
Partially fixes #494.

Co-Authored-by: Consolatis
2022-08-27 06:58:20 +01:00
Consolatis
1cdebbc22d src/ssd/ssd_titlebar.c: Completely hide title when running out of space
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
2022-08-12 14:56:51 +01:00
Johan Malm
429df42a8f menu: render submenu arrows 2022-08-12 11:16:17 +02:00
Consolatis
09915b8f43 src/ssd/ssd.c: Keep view->margin in sync when toggling decorations
Fixes #409
2022-06-30 06:45:18 +01:00
Consolatis
05ae654547 Convert SSD title to scaled font buffer 2022-06-14 22:03:08 +01:00
Consolatis
f3a685155d common/font: Add scale argument 2022-06-14 22:03:08 +01:00
Consolatis
ca9226a7a6 src/ssd: Convert button node descriptors to struct ssd_button
This allows for way easier button hover detection and future
features like toggling rounded corner buttons on maximize.
2022-06-09 22:04:35 +01:00
Consolatis
f1ada7e407 src/ssd: Use LAB_SSD_PART_CORNER_x for rounded corner backgrounds
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
2022-06-09 22:04:35 +01:00
Consolatis
efd9155513 Chase wlroots: children are now only availabe in tree nodes
Chases wlroots 71f8a48d380701de1e3331d53d470bd76f5f643b
wlr_scene: Move children list from wlr_scene_node to wlr_scene_tree
2022-06-07 07:13:37 +01:00
Consolatis
08518513cc Chase wlroots: scene_node.state is now inlined
Chases wlroots cb2dbc327e4d695c2a60a386e116a7dc20b29107
wlr_scene: Inline wlr_scene_node_state
2022-06-07 07:13:37 +01:00
Consolatis
2ed7a10779 Chase wlroots: every scene_node parent is now a tree
Chases wlroots ccd0f85c2a36308e35b153c7f9653abac7659af3
wlr_scene: Only allow parenting on a wlr_scene_tree
2022-06-07 07:13:37 +01:00
Consolatis
b7c9d0e055 Chase wlroots: prep work: ssd to tree 2022-06-07 07:13:37 +01:00
Consolatis
3f65a2ff77 Chase wlroots: wlr_scene is now a tree node
Chases wlroots 9eb71146ae56c509ee33c7e8a662549592aad870
wlr_scene: Refactor wlr_scene (the root element) to encase a wlr_scene_tree
2022-06-07 07:13:37 +01:00
Consolatis
ccfcd04625 Revert "Fix dynamic output based scaling for menu and SSD"
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.
2022-05-30 21:27:33 +02:00
Consolatis
e87aa19066 Fix dynamic output based scaling for menu and SSD
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.c

Fixes #348
2022-05-29 22:10:00 +02:00
Consolatis
bda48da68d Deal with font_buffer_create() failures 2022-05-26 22:19:56 +01:00
Consolatis
163179dda1 Chase wlroots: wlr_scene_surface
To update the wlroots subproject use
meson subprojects update wlroots
2022-05-26 06:48:00 +01:00
Johan Malm
60966f5fde src/ssd/ssd.c: remove superfluous WLR_ERROR log message 2022-04-28 22:33:56 +01:00
Johan Malm
5b34c81768 Fix trivial coding style breaches 2022-04-04 20:53:36 +01:00
Consolatis
4ee9f351ea ssd_extents: force initial manual ssd_extents update for x11 clients 2022-03-12 15:32:44 +00:00
Consolatis
3171aba0e2 ssd: dynamically adjust resize extents based on usable_area
Fixes #265
2022-03-12 15:32:44 +00:00
Consolatis
e086f6f5e0 ssd: move top border above titlebar 2022-03-12 15:32:44 +00:00
Consolatis
e4f1f9a975 ssd: use dynamic titlebar height based on font size and padding 2022-03-12 15:32:44 +00:00
Consolatis
3bb44fc9f2 ssd: increase resize corners 2022-03-12 15:32:44 +00:00
Johan Malm
a601615866 ssd: add top border
Raise border on top of (z-order) titlebar
2022-03-06 17:06:14 +00:00
Consolatis
5deeca833f ssd: Disable resize extents while in maximized or fullscreen state 2022-03-04 20:02:57 +00:00
Consolatis
7d98bc7aa2 ssd/ssd_titlebar.c: Only store title state if title has been changed 2022-02-24 06:56:25 +00:00
Consolatis
c033667716 src/ssd/: Don't access view->surface->current directly
Instead use view->{w,h} which are set on client commit
2022-02-24 06:56:25 +00:00
Consolatis
29021dad6a xdg/xwayland: Do not destroy scene node on unmap
This prevents segfaulting when unminimizing
2022-02-23 21:47:01 +00:00
Consolatis
5862b65f89 Convert SSD to scene nodes 2022-02-23 21:47:01 +00:00