Commit graph

164 commits

Author SHA1 Message Date
Daniel Eklöf
4d05947985
bar: deal with NULL exposables
Allow modules to return NULL in begin_expose()
2020-11-25 20:36:46 +01:00
Daniel Eklöf
008235d904
bar/wayland: close command pipe FDs in cleanup 2020-11-25 20:36:45 +01:00
Daniel Eklöf
328ebe8fe9
bar/wayland: plug memory leak: free seat name 2020-11-25 20:36:45 +01:00
Daniel Eklöf
1262f1b3d1
bar/wayland: use wl_*_release() instead of wl_*_destroy()
This lets the compositor free up internal state.
2020-11-09 19:53:57 +01:00
Daniel Eklöf
e25c42dc87
module/river: meson: explicitly add wl_proto_src + wl_proto_headers to sources
The ‘river’ module depends on generated protocol sources. These are
normally provided, indirectly, by the Wayland bar backend. But when
building plugins as shared modules, the plugins no longer depend on
the bar, and thus ‘river’ fails to build.

Fix this by doing two things:

* **Remove** the ‘river’ protocol from the ‘generic’ Wayland protocols
* Explicitly add both the generic and the ‘river’ specific protocols
  to the ‘river’ module.
2020-09-24 17:30:18 +02:00
Daniel Eklöf
c17e4b1110
meson: bar: remove unused list variable 2020-08-30 11:01:40 +02:00
Daniel Eklöf
7b2d524598
moduel/river: wip: new module; 'tags' status on Wayland compositor 'river' 2020-07-23 19:00:42 +02:00
Daniel Eklöf
588e6150d2
bar/wayland: do *not* set backend->scale in xdg_output_handle_done()
This is done by update_size(). Setting it in xdg_output_handle_done()
causes update_size() to do an early exit, and thus we end up never
actually configuring the surface.

We also never instantiate a pixman image, which led to a hard crash at
startup when the user had configured a specific output to use.
2020-07-20 17:30:20 +02:00
Daniel Eklöf
aa1b3457a1
bar/wayland: make sure we don't strcmp() a NULL pointer 2020-07-20 17:29:56 +02:00
Daniel Eklöf
e38f593acd
bar/wayland: don't try to set cursor surface if serial is 0 2020-07-11 07:39:02 +02:00
Daniel Eklöf
74933c40ee
bar/wayland: log error message when failing to load cursor (image) 2020-07-11 07:37:01 +02:00
Daniel Eklöf
84ba1c231a
bar/wayland: update cursor on pointer enter event 2020-07-10 18:38:00 +02:00
Daniel Eklöf
c03564513d
bar/wayland: seat: handle failure to create pointer surface 2020-07-10 18:37:39 +02:00
Daniel Eklöf
0a0ef8852a
bar/wayland: move seat.pointer.pointer -> seat.wl_pointer 2020-07-10 18:20:29 +02:00
Daniel Eklöf
f426155e0b
bar/wayland: explicitly refresh on scale changes
Just calling update_size() isn't enough, as that in itself doesn't
trigger a redraw.
2020-07-10 11:43:34 +02:00
Daniel Eklöf
6bf077240c
bar/wayland: update_size: release old buffer when reloading buffers 2020-07-10 11:43:12 +02:00
Daniel Eklöf
dd74b7f747
bar/wayland: don't initialize backend->scale = 1
This causes the first call to update_size() to exit early, and thus we
never configure the initial state.
2020-07-10 11:42:26 +02:00
Daniel Eklöf
31a4cddde3
bar/wayland: guess scale when no 'output' has been configured 2020-07-10 10:48:17 +02:00
Daniel Eklöf
d80fbd4084
bar/wayland: remove commented out code 2020-07-10 10:48:07 +02:00
Daniel Eklöf
d929c12ecb
bar/wayland: reload cursor theme: remember current pointer name
This allows us to avoid reloading the same pointer image again and
again.
2020-07-09 19:52:10 +02:00
Daniel Eklöf
f04b1e806c
bar: let backend check if xcursor should be updated or not
This allows the backend to support multi-seat "properly", by checking
against the correct seat. Before this, when we used a single, global
xcursor value, a seat whose pointer needed to be updated would not be
updated.
2020-07-09 19:02:02 +02:00
Daniel Eklöf
5884e665a4
bar/wayland: set-cursor: don't skip out if "old" xcursor is same as "new"
We might be setting on a different seat than before.
2020-07-09 18:55:04 +02:00
Daniel Eklöf
13c2b8296d
bar/wayland: resize surface+buffers on dynamic scale changes 2020-07-09 18:51:44 +02:00
Daniel Eklöf
40d47f8273
bar/wayland: handle seat removal 2020-07-07 20:52:25 +02:00
Daniel Eklöf
b658f577de
bar/wayland: don't roundtrip when adding globals
Instead, roundtrip once all globals have been handled. This means all
listeners have been registered.

When we detect a specific monitor to map to, and it has a non-default
scale, update the cursor theme (since it depends on the scale).
2020-07-07 20:44:17 +02:00
Daniel Eklöf
b73e3acd0a
bar/wayland: remove debug output 2020-07-07 16:42:57 +02:00
Daniel Eklöf
6f22edaba6
bar/wayland: multi-seat support
We only care about the mouse. We now track per-seat cursor positions
and cursor themes.

Any enter/leave/motion/button event will call the bar on_mouse()
method using the coordinates from the "current" seat.

Since the bar framework doesn't deal with multi-seats at all, we
internally, in the backend, track the currently active seat. This is
the seat which we last saw any kind of events from.

This is used in e.g. set_cursor(), which is called from the bar.
2020-07-07 14:09:25 +02:00
Daniel Eklöf
0678015eb1
bar/wayland: shutdown when compositor "closed" our layer surface 2020-04-28 18:58:27 +02:00
Daniel Eklöf
860ec01791
bar/wayland: log globals 2020-04-28 18:58:18 +02:00
Daniel Eklöf
c707b00a2a
bar/wayland: don't destroy pointer unnecessarily
We only need to create/destroy the pointer when the POINTER capability
changes.
2020-04-28 18:57:32 +02:00
Daniel Eklöf
c7cfb451e3
bar/wayland: spell compositor correctly 2020-04-27 20:50:36 +02:00
Daniel Eklöf
df1a004f97
bar/wayland: layer surface "namespace" is a category, not application ID 2020-02-06 19:11:16 +01:00
Daniel Eklöf
edfe7e70f9
bar/wayland: don't use wl_display_dispatch()
wl_display_dispatch() calls poll(), which is unnecessary since we
already know the FD is readable.

Use the more lower level wl_display_read_events() +
wl_display_dispatch_pending().

These require wl_display_prepare_read() to have been called.
2020-01-03 21:24:26 +01:00
Daniel Eklöf
baee3924e4
bar/wayland: let compositor choose output if user didn't
Instead of us selecting an output randomly (we used to select that
"last" output) when the user hasn't configured one, let the compositor
choose one for us.
2019-12-31 11:39:33 +01:00
Daniel Eklöf
e05d586f17
bar/wayland: WL_OUTPUT_MODE_PREFERRED doesn't meen this *output* is preferred
It means the *mode* (width, height, refresh) is the preferred one for
*this* output.
2019-12-31 11:16:23 +01:00
Daniel Eklöf
199a7ccd21
bar/wayland: change disconnected log type from warn -> info
Because being disconnected from Wayland is how we typically exit.
2019-11-23 13:50:29 +01:00
Daniel Eklöf
0550d2799d
tllist: use tllist from external git repository 2019-11-17 19:17:34 +01:00
Daniel Eklöf
736e07b15e
wayland: verify server implements the required interface versions 2019-11-03 16:17:17 +01:00
Daniel Eklöf
9dbbc480e4
Rename project: f00bar -> yambar 2019-09-28 20:39:45 +02:00
Daniel Eklöf
274255f9ab
bar: repair border drawing (was using wrong height)
Fix regression after porting from cairo to pixman. The bar border was
drawn using the wrong height info.
2019-09-22 12:38:30 +02:00
Daniel Eklöf
bd70a4dc37
bar: fix build failure with -Werror=unused-result 2019-09-22 12:32:02 +02:00
Daniel Eklöf
f29f96be96
bar/wayland: use preferred monitor if user didn't specify one 2019-09-22 12:08:08 +02:00
Daniel Eklöf
18e9d67d77
bar/wayland: fail when we can't find the specified monitor 2019-09-22 11:59:48 +02:00
Daniel Eklöf
5d6df44a79
bar: signal abort (to main loop) when backend fails 2019-09-22 11:59:34 +02:00
Daniel Eklöf
4ce314e328
cairo: drop all remaining references to cairo
We now use pixman (and freetype + fontconfig) exclusively.
2019-09-22 11:52:37 +02:00
Daniel Eklöf
01e71590e0
bar: don't use cairo
This is trivial in the Wayland backend; just instantiate a pixman
pointing to the same mmapped memory as the wayland buffer.

In the XCB backend, we change the implementation slightly; instead of
rendering via a cairo XCB surface backend (to a server side pixmap),
which is then blitted to the window in commit(), we now render to a
client-side pixman pixmap, and blit it using xcb_put_image() in
commit().
2019-09-22 11:46:46 +02:00
Daniel Eklöf
c11fee4ce3
cairo: replace cairo with pixman in decos, particles and modules
All decoration, particle and module interfaces now takes a
pixman_image_t parameter, and all drawing is done using pixman APIs.

The wayland/xcb backends implement a new interface functions,
get_pixman_image(), that should return a pixman image instance that is
suitable for rendering.

In the wayland backend, the image uses the same backing data as the
cairo surface.

In the XCB backend, we create a new image each time, and then blit it
to the cairo surface at commit time.
2019-09-22 01:56:58 +02:00
Daniel Eklöf
95385863ae
particle: remove cairo context from begin_expose() 2019-09-22 00:55:06 +02:00
Daniel Eklöf
9b5dca52e2
bar/wayland: scale mouse position on mouse entry 2019-07-05 10:27:33 +02:00
Daniel Eklöf
8567257a88
meson: no space before ':' 2019-06-07 22:42:21 +02:00