mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Preliminary support for xdg-output
No support for layout changes for the time being, though
This commit is contained in:
parent
114e265eef
commit
697942fc15
2 changed files with 11 additions and 4 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/render/wlr_texture.h>
|
||||
#include <wlr/types/wlr_xdg_output_v1.h>
|
||||
|
||||
#include "waybox/server.h"
|
||||
|
||||
|
|
@ -18,6 +19,8 @@ struct wb_output {
|
|||
struct wlr_output *wlr_output;
|
||||
struct wb_server *server;
|
||||
|
||||
struct wlr_xdg_output_manager_v1 *manager;
|
||||
|
||||
struct wl_listener destroy;
|
||||
struct wl_listener frame;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ struct render_data {
|
|||
struct timespec *when;
|
||||
};
|
||||
|
||||
static void render_surface(struct wlr_surface *surface, int sx, int sy, void *data) {
|
||||
static void render_surface(struct wlr_surface *surface,
|
||||
int sx, int sy, void *data) {
|
||||
/* This function is called for every surface that needs to be rendered. */
|
||||
struct render_data *rdata = data;
|
||||
struct wb_view *view = rdata->view;
|
||||
|
|
@ -49,8 +50,7 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy, void *da
|
|||
* prepares an orthographic projection and multiplies the necessary
|
||||
* transforms to produce a model-view-projection matrix.
|
||||
*
|
||||
* Naturally you can do this any way you like, for example to make a 3D
|
||||
* compositor.
|
||||
* Naturally you can do this any way you like.
|
||||
*/
|
||||
float matrix[9];
|
||||
enum wl_output_transform transform =
|
||||
|
|
@ -97,7 +97,8 @@ void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
.when = &now,
|
||||
};
|
||||
|
||||
wlr_xdg_surface_for_each_surface(view->xdg_surface, render_surface, &rdata);
|
||||
wlr_xdg_surface_for_each_surface(view->xdg_surface,
|
||||
render_surface, &rdata);
|
||||
}
|
||||
|
||||
wlr_output_render_software_cursors(output->wlr_output, NULL);
|
||||
|
|
@ -142,4 +143,7 @@ void new_output_notify(struct wl_listener *listener, void *data) {
|
|||
|
||||
wlr_output_layout_add_auto(server->layout, wlr_output);
|
||||
wlr_output_create_global(wlr_output);
|
||||
|
||||
output->manager = wlr_xdg_output_manager_v1_create(server->wl_display,
|
||||
server->layout);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue