mirror of
https://github.com/wizbright/waybox.git
synced 2025-11-02 09:01:42 -05:00
Merge pull request #21 from keithbowes/xdg-output
Preliminary support for xdg-output
This commit is contained in:
commit
252b8c0de5
3 changed files with 12 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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ protocols = [
|
||||||
[wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'],
|
[wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'],
|
||||||
[wl_protocol_dir, 'unstable/primary-selection/primary-selection-unstable-v1.xml'],
|
[wl_protocol_dir, 'unstable/primary-selection/primary-selection-unstable-v1.xml'],
|
||||||
[wl_protocol_dir, 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'],
|
[wl_protocol_dir, 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'],
|
||||||
|
[wl_protocol_dir, 'unstable/xdg-output/xdg-output-unstable-v1.xml'],
|
||||||
'wlr-gamma-control-unstable-v1.xml',
|
'wlr-gamma-control-unstable-v1.xml',
|
||||||
'idle.xml',
|
'idle.xml',
|
||||||
'wlr-screencopy-unstable-v1.xml',
|
'wlr-screencopy-unstable-v1.xml',
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -50,8 +51,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 =
|
||||||
|
|
@ -99,7 +99,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);
|
||||||
|
|
@ -146,4 +147,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