mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-31 22:25:28 -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_renderer.h>
|
||||||
#include <wlr/render/wlr_texture.h>
|
#include <wlr/render/wlr_texture.h>
|
||||||
|
#include <wlr/types/wlr_xdg_output_v1.h>
|
||||||
|
|
||||||
#include "waybox/server.h"
|
#include "waybox/server.h"
|
||||||
|
|
||||||
|
|
@ -18,6 +19,8 @@ struct wb_output {
|
||||||
struct wlr_output *wlr_output;
|
struct wlr_output *wlr_output;
|
||||||
struct wb_server *server;
|
struct wb_server *server;
|
||||||
|
|
||||||
|
struct wlr_xdg_output_manager_v1 *manager;
|
||||||
|
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
struct wl_listener frame;
|
struct wl_listener frame;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ struct render_data {
|
||||||
struct timespec *when;
|
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. */
|
/* This function is called for every surface that needs to be rendered. */
|
||||||
struct render_data *rdata = data;
|
struct render_data *rdata = data;
|
||||||
struct wb_view *view = rdata->view;
|
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
|
* prepares an orthographic projection and multiplies the necessary
|
||||||
* transforms to produce a model-view-projection matrix.
|
* transforms to produce a model-view-projection matrix.
|
||||||
*
|
*
|
||||||
* Naturally you can do this any way you like, for example to make a 3D
|
* Naturally you can do this any way you like.
|
||||||
* compositor.
|
|
||||||
*/
|
*/
|
||||||
float matrix[9];
|
float matrix[9];
|
||||||
enum wl_output_transform transform =
|
enum wl_output_transform transform =
|
||||||
|
|
@ -97,7 +97,8 @@ void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||||
.when = &now,
|
.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);
|
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_layout_add_auto(server->layout, wlr_output);
|
||||||
wlr_output_create_global(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