Commit Graph

64 Commits

Author SHA1 Message Date
John Lindgren bff5b2c559 Insert new outputs at the end of the list
This prevents auto-configuring a new output from changing the
position of existing outputs.

(v2: simplify insert-at-end logic)
2021-11-29 13:14:31 +00:00
Kirill Primak 111d4eafd7 util/addon: find both by owner and impl
This allows to have multiple addons of different types with the same
owner.
2021-08-11 18:12:57 +02:00
Kirill Primak debd6c5f0b wlr_output_layout: use wlr_addons 2021-08-10 19:15:48 +02:00
Simon Zeni e192d87731 move wlr_box from /types to /util 2021-07-06 21:43:17 +02:00
Simon Ser aab43b3c76 output-layout: stop listening to scale/transform events
Instead, listen to the commit event only.
2021-01-15 10:18:56 +01:00
Simon Ser 16e5e9541b Add -Wmissing-prototypes
This requires functions without a prototype definition to be static.
This allows to detect dead code, export less symbols and put shared
functions in headers.
2019-11-20 02:05:03 +00:00
Ilia Bozhinov 480a31ea4e wlr_box: properly calculate closest point for non-positive area boxes
If box->width/height is <= 0, the box doesn't contain any points, and so
there is no closest point. wlr_box_closest_point should return NAN in this
case.

In addition, we need to handle empty boxes in a few other
output-layout-related places, because outputs can have size 0x0 when
they are created or destroyed.
2019-10-11 23:43:13 +03:00
Antonin Décimo 217cf18a4b Avoid loss of a fractional part 2019-08-12 09:37:21 +09:00
emersion 1515c56cae output: remove lx, ly
Fixes https://github.com/swaywm/wlroots/issues/1610
2019-04-13 08:31:30 -06:00
Brian Ashworth aa5c369910 wlr_output_layout_get_box: handle empty layout
If there were no outputs in the output layout,
wlr_output_layout_get_box would return the box:

{
  .x = INT_MIN,
  .y = INT_MIN,
  .width = INT_MIN - INT_MAX,
  .height = INT_MIN - INT_MAX
}

which results in an integer underflow for both the width and height.

This changes the logic to have the box be all zeroes, since an empty
output layout does not have a width or height and the location of
something without a size is irrelevant so this just uses the origin.
2019-03-08 09:45:22 +01:00
Timidger 9af0c5338f
Standardize the wlr_box input paramaters
Fixes #1094
2018-12-21 13:56:10 -05:00
emersion dfdbc1f870
output-layout, cursor: fix duplicate cursors
wlr_cursor: make sure the output doesn't have a cursor before
creating a new one

wlr_output_layout: don't emit the "add" event when the output is
already in the layout
2018-10-19 14:50:35 +02:00
emersion 9f76263404 output-layout: don't expose outputs without a mode 2018-09-17 15:22:33 +02:00
Armin Preiml 5617d2bd60 introduce wlr_output_layout_farthest_output
Similar to wlr_output_layout_adjacent_output but will return the
one that is the farthest away from the reference in given direction.
2018-08-25 09:14:55 +02:00
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
Genki Sky d1cf9acbd5 cleanup: Use void for zero-parameter functions
Signed-off-by: Genki Sky <sky@genki.is>
2018-05-30 20:19:16 -04:00
emersion 625a7a48dc
Don't use the wlr_ prefix for static functions 2018-04-25 23:51:00 +01:00
Tony Crisci 5a47da1ea6 annotate wlr-output-layout coord variables 2018-04-01 00:17:27 -04:00
Tony Crisci bf5ae85683 return early when no dest_x/y in output layout closest point 2018-03-28 18:40:55 -04:00
Tony Crisci bbd0e23fa7 xdg-positioner constraint detection 2018-03-26 23:48:32 -04:00
emersion aa2b62fbff
output-layout: fix output global not destroyed 2018-03-01 17:53:15 +01:00
Drew DeVault 1d9be89e2d
Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
Drew DeVault 09cfa39392
Merge pull request #632 from acrisci/output-layout-adjacent
add wlr_output_layout_adjacent_output
2018-02-19 18:00:32 -05:00
Scott Anderson 86269052eb Explicitly export EFL symbols 2018-02-19 14:26:40 +13:00
Drew DeVault c951000198 Remove XXX comment 2018-02-18 11:21:08 -05:00
Tony Crisci 9933b7ad95 fix direction determination 2018-02-17 17:54:57 -05:00
Tony Crisci 85871cb666 add wlr_output_layout_adjacent_output 2018-02-14 14:10:31 -05:00
emersion c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion 36ead80cd1
Make wlr_signal_emit_safe private 2018-02-12 19:52:47 +01:00
emersion 5e58d46cc1
Add wlr_signal_emit_safe 2018-02-12 09:12:31 +01:00
Vincent Vanlaer 8dcb2f2d6b Prevent cursor from getting stuck at infinity 2018-02-04 22:40:24 +01:00
Markus Ongyerth 3cf7225cec decouples outputenable state and wl_output global
This decouples wlr_output_enable and the wl_global.
The previously internal functions wlr_output_(destroy/create)_global are
exposed and used automatically in the wlr_output_layout to create/tear
down the global.
The compositor can handle them itself if it wants to, but I think this
is the right moment to create/destroy the wl_output when the
wlr_output_layout is used.
2018-01-23 17:40:12 +01:00
emersion 33c427a6aa
output_layout: disabled outputs are just like enabled outputs 2018-01-07 18:40:58 +01:00
emersion 8ebd7d4dbe
output: rename resolution event to mode 2018-01-06 12:42:32 +01:00
emersion 6fe380a176
output_layout: handle output enable event 2018-01-06 12:39:15 +01:00
emersion 1fe1d64042
Fix views outside output layout 2017-12-31 12:49:06 +01:00
emersion 3b4b8953d9
Update output layout when scale or transform changes 2017-12-12 21:58:00 +01:00
emersion ca9dfd2e14
Emit add event after configuring wlr_output_layout_output 2017-10-31 12:30:57 +01:00
emersion 2e2d63a164
Manage wlr_output_cursor from wlr_cursor 2017-10-31 12:30:56 +01:00
emersion 88f85f7477
Fix code style issues 2017-10-31 12:01:49 +01:00
emersion 78245a3998
Check allocation errors in wlr_output_layout 2017-10-31 11:29:53 +01:00
Tony Crisci eaed6b6d29 wl-output: send layout position 2017-10-20 07:29:01 -04:00
Tony Crisci 19784360f1 bug: fix view centering 2017-10-16 14:35:16 -04:00
emersion 669a452aef
Fix wlr_output_layout_intersects 2017-10-10 20:05:10 +02:00
Tony Crisci e733b0e643 Rename wlr_output_layout_init()
Rename wlr_output_layout_init() to wlr_output_layout_create() to be consistent
with the rest of the api.
2017-09-05 17:53:29 -04:00
Tony Crisci 57c18c38bb wlr_cursor: handle layout changes
Add the layout `destroy` and `change` events.

When a layout is destroyed, detach is from the wlr_cursor.

When a layout is changed, warp the cursor to the closest layout boundary.
2017-09-05 07:48:28 -04:00
Tony Crisci d84deb0742 add wlr_output destroy event 2017-08-31 07:47:44 -04:00
Tony Crisci fa3d4ecc84 fix layout hotplugging issue in output-layout.c 2017-08-31 07:47:44 -04:00
Tony Crisci f25511ee3d refactor wlr_output_layout to use wlr_box 2017-08-31 07:47:44 -04:00
Tony Crisci 40bd6bcc43 implement output layout auto configuration 2017-08-31 07:47:44 -04:00