typedefs and comments
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void reset_cursor_mode(struct absinthe_server *server);
|
void reset_cursor_mode(absn_server *server);
|
||||||
void process_cursor_motion(struct absinthe_server *server, uint32_t time);
|
void process_cursor_motion(absn_server *server, uint32_t time);
|
||||||
|
|||||||
+4
-4
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void focus_toplevel(struct absinthe_toplevel *toplevel);
|
void focus_toplevel(absn_toplevel *toplevel);
|
||||||
|
|
||||||
struct absinthe_toplevel *focus_get_topmost(struct absinthe_server *server);
|
absn_toplevel *focus_get_topmost(absn_server *server);
|
||||||
|
|
||||||
void focus_next(struct absinthe_server *server);
|
void focus_next(absn_server *server);
|
||||||
void focus_prev(struct absinthe_server *server);
|
void focus_prev(absn_server *server);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void layout_arrange(struct absinthe_output *output);
|
void layout_arrange(absn_output *output);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -10,6 +10,6 @@ void output_request_state(struct wl_listener *listener, void *data);
|
|||||||
void output_destroy(struct wl_listener *listener, void *data);
|
void output_destroy(struct wl_listener *listener, void *data);
|
||||||
void output_layout_change(struct wl_listener *listener, void *data);
|
void output_layout_change(struct wl_listener *listener, void *data);
|
||||||
|
|
||||||
void update_focused_output(struct absinthe_server *server);
|
void update_focused_output(absn_server *server);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+9
-12
@@ -3,20 +3,17 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
struct absinthe_toplevel *toplevel_at(struct absinthe_server *server, double lx,
|
absn_toplevel *toplevel_at(absn_server *server, double lx, double ly,
|
||||||
double ly, struct wlr_surface **surface, double *sx, double *sy);
|
struct wlr_surface **surface, double *sx, double *sy);
|
||||||
|
|
||||||
bool toplevel_is_unmanaged(struct absinthe_toplevel *toplevel);
|
bool toplevel_is_unmanaged(absn_toplevel *toplevel);
|
||||||
|
|
||||||
void toplevel_update_geom(struct absinthe_toplevel *toplevel);
|
void toplevel_get_geom(absn_toplevel *toplevel);
|
||||||
void toplevel_update_borders_geom(struct absinthe_toplevel *toplevel);
|
|
||||||
|
|
||||||
void toplevel_set_pos(struct absinthe_toplevel *toplevel, int32_t x, int32_t y);
|
void toplevel_set_pos(absn_toplevel *toplevel, int32_t x, int32_t y);
|
||||||
void toplevel_set_size(struct absinthe_toplevel *toplevel, int32_t width,
|
void toplevel_set_size(absn_toplevel *toplevel, int32_t width, int32_t height);
|
||||||
int32_t height);
|
void toplevel_set_geom(absn_toplevel *toplevel, struct wlr_box *geom);
|
||||||
void toplevel_set_fullscreen(struct absinthe_toplevel *toplevel,
|
void toplevel_set_fullscreen(absn_toplevel *toplevel, bool fullscreen);
|
||||||
bool fullscreen);
|
void toplevel_set_border_color(absn_toplevel *toplevel, const float color[4]);
|
||||||
void toplevel_set_border_color(struct absinthe_toplevel *toplevel,
|
|
||||||
const float color[4]);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+31
-24
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#define MAX(A, B) (A) > (B) ? (A) : (B)
|
#define MAX(A, B) (A) > (B) ? (A) : (B)
|
||||||
#define MIN(A, B) (A) < (B) ? (A) : (B)
|
#define MIN(A, B) (A) < (B) ? (A) : (B)
|
||||||
|
/* macro for adding listener for event */
|
||||||
#define LISTEN(L, C, E) \
|
#define LISTEN(L, C, E) \
|
||||||
do { \
|
do { \
|
||||||
(L).notify = (C); \
|
(L).notify = (C); \
|
||||||
@@ -31,12 +32,14 @@
|
|||||||
} while (0);
|
} while (0);
|
||||||
#define UNUSED(X) (void)(X)
|
#define UNUSED(X) (void)(X)
|
||||||
|
|
||||||
|
/* cursor mode */
|
||||||
enum {
|
enum {
|
||||||
CURSOR_PASSTHROUGH,
|
CURSOR_PASSTHROUGH,
|
||||||
CURSOR_MOVE,
|
CURSOR_MOVE,
|
||||||
CURSOR_RESIZE,
|
CURSOR_RESIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* resizing corners */
|
||||||
enum {
|
enum {
|
||||||
TOP_LEFT,
|
TOP_LEFT,
|
||||||
TOP_RIGHT,
|
TOP_RIGHT,
|
||||||
@@ -44,12 +47,14 @@ enum {
|
|||||||
BOTTOM_RIGHT,
|
BOTTOM_RIGHT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* toplevel types */
|
||||||
enum {
|
enum {
|
||||||
TOPLEVEL_XDG,
|
TOPLEVEL_XDG,
|
||||||
TOPLEVEL_X11,
|
TOPLEVEL_X11,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum absinthe_layers {
|
/* layers for wlr layer shell */
|
||||||
|
enum {
|
||||||
LAYER_BACKGROUND,
|
LAYER_BACKGROUND,
|
||||||
LAYER_BOTTOM,
|
LAYER_BOTTOM,
|
||||||
LAYER_TILE,
|
LAYER_TILE,
|
||||||
@@ -61,9 +66,10 @@ enum absinthe_layers {
|
|||||||
LAYERS_COUNT,
|
LAYERS_COUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct absinthe_output;
|
typedef struct absn_output absn_output;
|
||||||
|
typedef struct absn_toplevel absn_toplevel;
|
||||||
|
|
||||||
struct absinthe_server {
|
typedef struct {
|
||||||
struct wl_display *display;
|
struct wl_display *display;
|
||||||
struct wlr_backend *backend;
|
struct wlr_backend *backend;
|
||||||
struct wlr_renderer *renderer;
|
struct wlr_renderer *renderer;
|
||||||
@@ -110,9 +116,9 @@ struct absinthe_server {
|
|||||||
|
|
||||||
struct wl_list toplevels;
|
struct wl_list toplevels;
|
||||||
struct wl_list focus_stack;
|
struct wl_list focus_stack;
|
||||||
struct absinthe_toplevel *focused_toplevel;
|
absn_toplevel *focused_toplevel;
|
||||||
|
|
||||||
struct absinthe_output *focused_output;
|
absn_output *focused_output;
|
||||||
struct wl_list outputs;
|
struct wl_list outputs;
|
||||||
struct wl_listener new_output;
|
struct wl_listener new_output;
|
||||||
struct wlr_output_layout *output_layout;
|
struct wlr_output_layout *output_layout;
|
||||||
@@ -120,11 +126,11 @@ struct absinthe_server {
|
|||||||
struct wlr_output_manager_v1 *output_mgr;
|
struct wlr_output_manager_v1 *output_mgr;
|
||||||
struct wl_listener mgr_apply;
|
struct wl_listener mgr_apply;
|
||||||
struct wl_listener mgr_test;
|
struct wl_listener mgr_test;
|
||||||
};
|
} absn_server;
|
||||||
|
|
||||||
struct absinthe_output {
|
struct absn_output {
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct absinthe_server *server;
|
absn_server *server;
|
||||||
|
|
||||||
struct wlr_box geom;
|
struct wlr_box geom;
|
||||||
struct wlr_box usable_area;
|
struct wlr_box usable_area;
|
||||||
@@ -135,12 +141,12 @@ struct absinthe_output {
|
|||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
|
|
||||||
float mstack_width;
|
float mstack_width;
|
||||||
float mstack_size;
|
int mstack_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct absinthe_layer_surface {
|
typedef struct {
|
||||||
struct absinthe_server *server;
|
absn_server *server;
|
||||||
struct absinthe_output *output;
|
absn_output *output;
|
||||||
|
|
||||||
struct wlr_scene_tree *scene_tree;
|
struct wlr_scene_tree *scene_tree;
|
||||||
struct wlr_scene_tree *scene_layer;
|
struct wlr_scene_tree *scene_layer;
|
||||||
@@ -151,15 +157,13 @@ struct absinthe_layer_surface {
|
|||||||
struct wl_listener unmap;
|
struct wl_listener unmap;
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
};
|
} absn_layer_surface;
|
||||||
|
|
||||||
struct absinthe_toplevel {
|
|
||||||
int type;
|
|
||||||
|
|
||||||
|
struct absn_toplevel {
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct wl_list flink;
|
struct wl_list flink; /* link for focus stack */
|
||||||
struct absinthe_server *server;
|
absn_server *server;
|
||||||
struct absinthe_output *output;
|
absn_output *output;
|
||||||
|
|
||||||
struct wlr_scene_tree *scene_tree;
|
struct wlr_scene_tree *scene_tree;
|
||||||
struct wlr_scene_tree *scene_surface;
|
struct wlr_scene_tree *scene_surface;
|
||||||
@@ -175,10 +179,12 @@ struct absinthe_toplevel {
|
|||||||
struct wlr_box geom;
|
struct wlr_box geom;
|
||||||
struct wlr_box prev_geom;
|
struct wlr_box prev_geom;
|
||||||
|
|
||||||
|
int type;
|
||||||
union {
|
union {
|
||||||
struct wlr_xdg_toplevel *xdg;
|
struct wlr_xdg_toplevel *xdg;
|
||||||
struct wlr_xwayland_surface *xw;
|
struct wlr_xwayland_surface *xw;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wl_listener map;
|
struct wl_listener map;
|
||||||
struct wl_listener unmap;
|
struct wl_listener unmap;
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
@@ -199,19 +205,20 @@ struct absinthe_toplevel {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct absinthe_popup {
|
typedef struct {
|
||||||
struct wlr_xdg_popup *wlr;
|
struct wlr_xdg_popup *wlr;
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
};
|
} absn_popup;
|
||||||
|
|
||||||
struct absinthe_keyboard {
|
typedef struct {
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct absinthe_server *server;
|
absn_server *server;
|
||||||
|
|
||||||
struct wlr_keyboard *wlr;
|
struct wlr_keyboard *wlr;
|
||||||
struct wl_listener modifiers;
|
struct wl_listener modifiers;
|
||||||
struct wl_listener key;
|
struct wl_listener key;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
};
|
} absn_keyboard;
|
||||||
|
|
||||||
#endif /* __TYPES_H_ */
|
#endif /* __TYPES_H_ */
|
||||||
|
|||||||
+5
-5
@@ -23,7 +23,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
setup(struct absinthe_server *server)
|
setup(absn_server *server)
|
||||||
{
|
{
|
||||||
wlr_log_init(WLR_DEBUG, NULL);
|
wlr_log_init(WLR_DEBUG, NULL);
|
||||||
server->display = wl_display_create();
|
server->display = wl_display_create();
|
||||||
@@ -182,7 +182,7 @@ setup(struct absinthe_server *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cleanup(struct absinthe_server *server)
|
cleanup(absn_server *server)
|
||||||
{
|
{
|
||||||
wl_display_destroy_clients(server->display);
|
wl_display_destroy_clients(server->display);
|
||||||
|
|
||||||
@@ -215,9 +215,9 @@ cleanup(struct absinthe_server *server)
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
struct absinthe_server server = { 0 };
|
absn_server server = { 0 };
|
||||||
int error = setup(&server);
|
int err = setup(&server);
|
||||||
if (error)
|
if (err)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
wl_display_run(server.display);
|
wl_display_run(server.display);
|
||||||
cleanup(&server);
|
cleanup(&server);
|
||||||
|
|||||||
+16
-17
@@ -6,7 +6,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
reset_cursor_mode(struct absinthe_server *server)
|
reset_cursor_mode(absn_server *server)
|
||||||
{
|
{
|
||||||
server->cursor_mode = CURSOR_PASSTHROUGH;
|
server->cursor_mode = CURSOR_PASSTHROUGH;
|
||||||
wlr_cursor_set_xcursor(server->cursor, server->cursor_mgr, "default");
|
wlr_cursor_set_xcursor(server->cursor, server->cursor_mgr, "default");
|
||||||
@@ -17,9 +17,9 @@ reset_cursor_mode(struct absinthe_server *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_cursor_move(struct absinthe_server *server)
|
process_cursor_move(absn_server *server)
|
||||||
{
|
{
|
||||||
struct absinthe_toplevel *toplevel = server->focused_toplevel;
|
struct absn_toplevel *toplevel = server->focused_toplevel;
|
||||||
|
|
||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
return;
|
return;
|
||||||
@@ -41,7 +41,7 @@ process_cursor_move(struct absinthe_server *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
apply_resize(struct absinthe_toplevel *toplevel, struct wlr_box *new_geometry)
|
apply_resize(absn_toplevel *toplevel, struct wlr_box *new_geom)
|
||||||
{
|
{
|
||||||
if (toplevel->type == TOPLEVEL_XDG) {
|
if (toplevel->type == TOPLEVEL_XDG) {
|
||||||
int32_t min_width = toplevel->xdg->current.min_width;
|
int32_t min_width = toplevel->xdg->current.min_width;
|
||||||
@@ -56,27 +56,26 @@ apply_resize(struct absinthe_toplevel *toplevel, struct wlr_box *new_geometry)
|
|||||||
if (max_height == 0)
|
if (max_height == 0)
|
||||||
max_height = 10000;
|
max_height = 10000;
|
||||||
|
|
||||||
if (!(new_geometry->width >= min_width &&
|
if (!(new_geom->width >= min_width &&
|
||||||
new_geometry->width <= max_width)) {
|
new_geom->width <= max_width)) {
|
||||||
new_geometry->width = toplevel->geom.width;
|
new_geom->width = toplevel->geom.width;
|
||||||
new_geometry->x = toplevel->geom.x;
|
new_geom->x = toplevel->geom.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(new_geometry->height >= min_height &&
|
if (!(new_geom->height >= min_height &&
|
||||||
new_geometry->height <= max_height)) {
|
new_geom->height <= max_height)) {
|
||||||
new_geometry->height = toplevel->geom.height;
|
new_geom->height = toplevel->geom.height;
|
||||||
new_geometry->y = toplevel->geom.y;
|
new_geom->y = toplevel->geom.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toplevel_set_size(toplevel, new_geometry->width, new_geometry->height);
|
toplevel_set_geom(toplevel, new_geom);
|
||||||
toplevel_set_pos(toplevel, new_geometry->x, new_geometry->y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_cursor_resize(struct absinthe_server *server)
|
process_cursor_resize(absn_server *server)
|
||||||
{
|
{
|
||||||
struct absinthe_toplevel *toplevel = server->focused_toplevel;
|
struct absn_toplevel *toplevel = server->focused_toplevel;
|
||||||
|
|
||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
return;
|
return;
|
||||||
@@ -142,7 +141,7 @@ process_cursor_resize(struct absinthe_server *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
process_cursor_motion(struct absinthe_server *server, uint32_t time)
|
process_cursor_motion(absn_server *server, uint32_t time)
|
||||||
{
|
{
|
||||||
double sx, sy;
|
double sx, sy;
|
||||||
struct wlr_surface *surface = NULL;
|
struct wlr_surface *surface = NULL;
|
||||||
|
|||||||
+15
-11
@@ -7,12 +7,12 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
focus_toplevel(struct absinthe_toplevel *toplevel)
|
focus_toplevel(absn_toplevel *toplevel)
|
||||||
{
|
{
|
||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct absinthe_server *server = toplevel->server;
|
absn_server *server = toplevel->server;
|
||||||
struct wlr_seat *seat = server->seat;
|
struct wlr_seat *seat = server->seat;
|
||||||
struct wlr_surface *prev_surface = seat->keyboard_state.focused_surface;
|
struct wlr_surface *prev_surface = seat->keyboard_state.focused_surface;
|
||||||
struct wlr_surface *surface;
|
struct wlr_surface *surface;
|
||||||
@@ -60,10 +60,14 @@ focus_toplevel(struct absinthe_toplevel *toplevel)
|
|||||||
&keyboard->modifiers);
|
&keyboard->modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct absinthe_toplevel *
|
/*
|
||||||
focus_get_topmost(struct absinthe_server *server)
|
* get first toplevel on monitor
|
||||||
|
* (last focused toplevel)
|
||||||
|
*/
|
||||||
|
absn_toplevel *
|
||||||
|
focus_get_topmost(absn_server *server)
|
||||||
{
|
{
|
||||||
struct absinthe_toplevel *toplevel;
|
absn_toplevel *toplevel;
|
||||||
wl_list_for_each(toplevel, &server->focus_stack, flink)
|
wl_list_for_each(toplevel, &server->focus_stack, flink)
|
||||||
{
|
{
|
||||||
if (toplevel)
|
if (toplevel)
|
||||||
@@ -73,13 +77,13 @@ focus_get_topmost(struct absinthe_server *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
focus_next(struct absinthe_server *server)
|
focus_next(absn_server *server)
|
||||||
{
|
{
|
||||||
struct absinthe_toplevel *toplevel = focus_get_topmost(server);
|
absn_toplevel *toplevel = focus_get_topmost(server);
|
||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct absinthe_toplevel *next;
|
absn_toplevel *next;
|
||||||
wl_list_for_each(next, &toplevel->link, link)
|
wl_list_for_each(next, &toplevel->link, link)
|
||||||
{
|
{
|
||||||
if (&next->link == &toplevel->server->toplevels)
|
if (&next->link == &toplevel->server->toplevels)
|
||||||
@@ -90,13 +94,13 @@ focus_next(struct absinthe_server *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
focus_prev(struct absinthe_server *server)
|
focus_prev(absn_server *server)
|
||||||
{
|
{
|
||||||
struct absinthe_toplevel *toplevel = focus_get_topmost(server);
|
absn_toplevel *toplevel = focus_get_topmost(server);
|
||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct absinthe_toplevel *prev;
|
absn_toplevel *prev;
|
||||||
wl_list_for_each_reverse(prev, &toplevel->link, link)
|
wl_list_for_each_reverse(prev, &toplevel->link, link)
|
||||||
{
|
{
|
||||||
if (&prev->link == &toplevel->server->toplevels)
|
if (&prev->link == &toplevel->server->toplevels)
|
||||||
|
|||||||
+13
-13
@@ -14,7 +14,7 @@ void
|
|||||||
handle_modifiers(struct wl_listener *listener, void *data)
|
handle_modifiers(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_keyboard *keyboard = wl_container_of(listener, keyboard,
|
absn_keyboard *keyboard = wl_container_of(listener, keyboard,
|
||||||
modifiers);
|
modifiers);
|
||||||
|
|
||||||
wlr_seat_set_keyboard(keyboard->server->seat, keyboard->wlr);
|
wlr_seat_set_keyboard(keyboard->server->seat, keyboard->wlr);
|
||||||
@@ -23,7 +23,7 @@ handle_modifiers(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
handle_keybind(struct absinthe_server *server, xkb_keysym_t keysym)
|
handle_keybind(absn_server *server, xkb_keysym_t keysym)
|
||||||
{
|
{
|
||||||
switch (keysym) {
|
switch (keysym) {
|
||||||
case XKB_KEY_Escape:
|
case XKB_KEY_Escape:
|
||||||
@@ -64,14 +64,14 @@ handle_keybind(struct absinthe_server *server, xkb_keysym_t keysym)
|
|||||||
break;
|
break;
|
||||||
case XKB_KEY_H:
|
case XKB_KEY_H:
|
||||||
if (server->focused_output) {
|
if (server->focused_output) {
|
||||||
server->focused_output->mstack_size += 1;
|
server->focused_output->mstack_count += 1;
|
||||||
layout_arrange(server->focused_output);
|
layout_arrange(server->focused_output);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XKB_KEY_L:
|
case XKB_KEY_L:
|
||||||
if (server->focused_output &&
|
if (server->focused_output &&
|
||||||
server->focused_output->mstack_size > 1) {
|
server->focused_output->mstack_count > 1) {
|
||||||
server->focused_output->mstack_size -= 1;
|
server->focused_output->mstack_count -= 1;
|
||||||
layout_arrange(server->focused_output);
|
layout_arrange(server->focused_output);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -84,8 +84,7 @@ handle_keybind(struct absinthe_server *server, xkb_keysym_t keysym)
|
|||||||
void
|
void
|
||||||
handle_key(struct wl_listener *listener, void *data)
|
handle_key(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_keyboard *keyboard = wl_container_of(listener, keyboard,
|
absn_keyboard *keyboard = wl_container_of(listener, keyboard, key);
|
||||||
key);
|
|
||||||
struct wlr_keyboard_key_event *event = data;
|
struct wlr_keyboard_key_event *event = data;
|
||||||
|
|
||||||
uint32_t keycode = event->keycode + 8;
|
uint32_t keycode = event->keycode + 8;
|
||||||
@@ -102,18 +101,19 @@ handle_key(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!handled) {
|
if (handled)
|
||||||
wlr_seat_set_keyboard(keyboard->server->seat, keyboard->wlr);
|
return;
|
||||||
wlr_seat_keyboard_notify_key(keyboard->server->seat,
|
|
||||||
event->time_msec, event->keycode, event->state);
|
wlr_seat_set_keyboard(keyboard->server->seat, keyboard->wlr);
|
||||||
}
|
wlr_seat_keyboard_notify_key(keyboard->server->seat, event->time_msec,
|
||||||
|
event->keycode, event->state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
handle_destroy(struct wl_listener *listener, void *data)
|
handle_destroy(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_keyboard *keyboard = wl_container_of(listener, keyboard,
|
absn_keyboard *keyboard = wl_container_of(listener, keyboard,
|
||||||
modifiers);
|
modifiers);
|
||||||
|
|
||||||
wl_list_remove(&keyboard->modifiers.link);
|
wl_list_remove(&keyboard->modifiers.link);
|
||||||
|
|||||||
+56
-42
@@ -1,16 +1,15 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "focus.h"
|
|
||||||
#include "toplevel.h"
|
#include "toplevel.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
layout_arrange(struct absinthe_output *output)
|
layout_arrange(struct absn_output *output)
|
||||||
{
|
{
|
||||||
if (!output)
|
if (!output)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct absinthe_toplevel *toplevel;
|
struct absn_toplevel *toplevel;
|
||||||
size_t toplevels_count = 0;
|
int toplevels_count = 0;
|
||||||
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
||||||
{
|
{
|
||||||
if (toplevel->output == output && toplevel->tiled) {
|
if (toplevel->output == output && toplevel->tiled) {
|
||||||
@@ -23,7 +22,8 @@ layout_arrange(struct absinthe_output *output)
|
|||||||
if (toplevels_count < 1)
|
if (toplevels_count < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int32_t output_gap = OUTPUT_GAP;
|
int32_t og = OUTPUT_GAP;
|
||||||
|
struct wlr_box new_geom;
|
||||||
|
|
||||||
if (toplevels_count == 1) {
|
if (toplevels_count == 1) {
|
||||||
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
||||||
@@ -31,37 +31,41 @@ layout_arrange(struct absinthe_output *output)
|
|||||||
if (toplevel->output == output && toplevel->tiled)
|
if (toplevel->output == output && toplevel->tiled)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int32_t new_x = output->geom.x + output_gap;
|
new_geom.x = output->geom.x + og,
|
||||||
int32_t new_y = output->geom.y + output_gap;
|
new_geom.y = output->geom.y + og,
|
||||||
toplevel_set_size(toplevel, output->geom.width - 2 * output_gap,
|
new_geom.width = output->geom.width - 2 * og,
|
||||||
output->geom.height - 2 * output_gap);
|
new_geom.height = output->geom.height - 2 * og,
|
||||||
toplevel_set_pos(toplevel, new_x, new_y);
|
|
||||||
|
toplevel_set_geom(toplevel, &new_geom);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t layout_gap = LAYOUT_GAP;
|
int32_t lg = LAYOUT_GAP;
|
||||||
int32_t main_stack_width = (toplevels_count <= output->mstack_size) ?
|
int32_t main_stack_width = (toplevels_count <= output->mstack_count) ?
|
||||||
output->geom.width - 2 * output_gap :
|
output->geom.width - 2 * og :
|
||||||
output->mstack_width * (output->geom.width - 2 * output_gap);
|
output->mstack_width * (output->geom.width - 2 * og);
|
||||||
int32_t width = output->geom.width - main_stack_width - 2 * output_gap -
|
int32_t w = output->geom.width - main_stack_width - 2 * og - lg;
|
||||||
layout_gap;
|
int32_t h;
|
||||||
int32_t height;
|
int32_t dy = og;
|
||||||
int32_t dy = output_gap;
|
int i = 0;
|
||||||
size_t i = 0;
|
|
||||||
|
|
||||||
if (toplevels_count <= output->mstack_size) {
|
if (toplevels_count <= output->mstack_count) {
|
||||||
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
||||||
{
|
{
|
||||||
if (toplevel->output != output || !toplevel->tiled)
|
if (toplevel->output != output || !toplevel->tiled)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
height = (output->geom.height - dy - output_gap) /
|
h = (output->geom.height - dy - og) /
|
||||||
(toplevels_count - i);
|
(toplevels_count - i);
|
||||||
int32_t new_x = output->geom.x + output_gap;
|
|
||||||
int32_t new_y = output->geom.y + dy;
|
new_geom.x = output->geom.x + og;
|
||||||
toplevel_set_pos(toplevel, new_x, new_y);
|
new_geom.y = output->geom.y + dy;
|
||||||
toplevel_set_size(toplevel, main_stack_width, height);
|
new_geom.width = main_stack_width;
|
||||||
dy += height + layout_gap;
|
new_geom.height = h;
|
||||||
|
|
||||||
|
toplevel_set_geom(toplevel, &new_geom);
|
||||||
|
|
||||||
|
dy += h + lg;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@@ -73,24 +77,34 @@ layout_arrange(struct absinthe_output *output)
|
|||||||
if (toplevel->output != output || !toplevel->tiled)
|
if (toplevel->output != output || !toplevel->tiled)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (i < output->mstack_size) {
|
if (i < output->mstack_count) {
|
||||||
height = (output->geom.height - dy - output_gap) /
|
h = (output->geom.height - dy - og) /
|
||||||
(output->mstack_size - i);
|
(output->mstack_count - i);
|
||||||
int32_t new_x = output->geom.x + output_gap;
|
|
||||||
int32_t new_y = output->geom.y + dy;
|
new_geom.x = output->geom.x + og;
|
||||||
toplevel_set_pos(toplevel, new_x, new_y);
|
new_geom.y = output->geom.y + dy;
|
||||||
toplevel_set_size(toplevel, main_stack_width, height);
|
new_geom.width = main_stack_width;
|
||||||
dy += height + layout_gap;
|
new_geom.height = h;
|
||||||
|
|
||||||
|
toplevel_set_geom(toplevel, &new_geom);
|
||||||
|
|
||||||
|
dy += h + lg;
|
||||||
} else {
|
} else {
|
||||||
if (i == output->mstack_size)
|
if (i == output->mstack_count)
|
||||||
dy = output_gap;
|
dy = og;
|
||||||
height = (output->geom.height - dy - output_gap) /
|
|
||||||
|
h = (output->geom.height - dy - og) /
|
||||||
(toplevels_count - i);
|
(toplevels_count - i);
|
||||||
toplevel->geom.x = output->geom.x + main_stack_width +
|
|
||||||
layout_gap + output_gap;
|
new_geom.x = output->geom.x + main_stack_width + lg +
|
||||||
toplevel->geom.y = output->geom.y + dy;
|
og;
|
||||||
toplevel_set_size(toplevel, width, height);
|
new_geom.y = output->geom.y + dy;
|
||||||
dy += height + layout_gap;
|
new_geom.width = w;
|
||||||
|
new_geom.height = h;
|
||||||
|
|
||||||
|
toplevel_set_geom(toplevel, &new_geom);
|
||||||
|
|
||||||
|
dy += h + lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|||||||
+9
-11
@@ -11,13 +11,12 @@ output_frame(struct wl_listener *listener, void *data)
|
|||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
struct absinthe_output *output = wl_container_of(listener, output,
|
absn_output *output = wl_container_of(listener, output, frame);
|
||||||
frame);
|
|
||||||
struct wlr_scene *scene = output->server->scene;
|
struct wlr_scene *scene = output->server->scene;
|
||||||
struct wlr_scene_output *scene_output =
|
struct wlr_scene_output *scene_output =
|
||||||
wlr_scene_get_scene_output(scene, output->wlr);
|
wlr_scene_get_scene_output(scene, output->wlr);
|
||||||
|
|
||||||
struct absinthe_toplevel *toplevel;
|
absn_toplevel *toplevel;
|
||||||
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
wl_list_for_each(toplevel, &output->server->toplevels, link)
|
||||||
{
|
{
|
||||||
if (toplevel->resizing && toplevel->output == output)
|
if (toplevel->resizing && toplevel->output == output)
|
||||||
@@ -34,7 +33,7 @@ skip:
|
|||||||
void
|
void
|
||||||
output_request_state(struct wl_listener *listener, void *data)
|
output_request_state(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_output *output = wl_container_of(listener, output,
|
struct absn_output *output = wl_container_of(listener, output,
|
||||||
request_state);
|
request_state);
|
||||||
const struct wlr_output_event_request_state *event = data;
|
const struct wlr_output_event_request_state *event = data;
|
||||||
wlr_output_commit_state(output->wlr, event->state);
|
wlr_output_commit_state(output->wlr, event->state);
|
||||||
@@ -44,7 +43,7 @@ void
|
|||||||
output_destroy(struct wl_listener *listener, void *data)
|
output_destroy(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_output *output = wl_container_of(listener, output,
|
struct absn_output *output = wl_container_of(listener, output,
|
||||||
request_state);
|
request_state);
|
||||||
|
|
||||||
wl_list_remove(&output->frame.link);
|
wl_list_remove(&output->frame.link);
|
||||||
@@ -58,13 +57,12 @@ void
|
|||||||
output_layout_change(struct wl_listener *listener, void *data)
|
output_layout_change(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, layout_change);
|
||||||
layout_change);
|
|
||||||
struct wlr_output_configuration_v1 *config =
|
struct wlr_output_configuration_v1 *config =
|
||||||
wlr_output_configuration_v1_create();
|
wlr_output_configuration_v1_create();
|
||||||
|
|
||||||
struct absinthe_toplevel *toplevel = NULL;
|
absn_toplevel *toplevel = NULL;
|
||||||
struct absinthe_output *output;
|
absn_output *output;
|
||||||
struct wlr_output_configuration_head_v1 *config_head;
|
struct wlr_output_configuration_head_v1 *config_head;
|
||||||
|
|
||||||
wl_list_for_each(output, &server->outputs, link)
|
wl_list_for_each(output, &server->outputs, link)
|
||||||
@@ -126,9 +124,9 @@ output_layout_change(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
update_focused_output(struct absinthe_server *server)
|
update_focused_output(absn_server *server)
|
||||||
{
|
{
|
||||||
struct absinthe_output *output;
|
absn_output *output;
|
||||||
int32_t cursor_x = server->cursor->x;
|
int32_t cursor_x = server->cursor->x;
|
||||||
int32_t cursor_y = server->cursor->y;
|
int32_t cursor_y = server->cursor->y;
|
||||||
wl_list_for_each(output, &server->outputs, link)
|
wl_list_for_each(output, &server->outputs, link)
|
||||||
|
|||||||
+3
-4
@@ -6,8 +6,7 @@
|
|||||||
void
|
void
|
||||||
request_cursor(struct wl_listener *listener, void *data)
|
request_cursor(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, request_cursor);
|
||||||
request_cursor);
|
|
||||||
struct wlr_seat_pointer_request_set_cursor_event *event = data;
|
struct wlr_seat_pointer_request_set_cursor_event *event = data;
|
||||||
struct wlr_seat_client *client =
|
struct wlr_seat_client *client =
|
||||||
server->seat->pointer_state.focused_client;
|
server->seat->pointer_state.focused_client;
|
||||||
@@ -20,7 +19,7 @@ request_cursor(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
pointer_focus_change(struct wl_listener *listener, void *data)
|
pointer_focus_change(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server,
|
||||||
pointer_focus_change);
|
pointer_focus_change);
|
||||||
struct wlr_seat_pointer_focus_change_event *event = data;
|
struct wlr_seat_pointer_focus_change_event *event = data;
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ pointer_focus_change(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
request_set_selection(struct wl_listener *listener, void *data)
|
request_set_selection(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server,
|
||||||
request_set_selection);
|
request_set_selection);
|
||||||
struct wlr_seat_request_set_selection_event *event = data;
|
struct wlr_seat_request_set_selection_event *event = data;
|
||||||
|
|
||||||
|
|||||||
+25
-34
@@ -26,8 +26,7 @@
|
|||||||
void
|
void
|
||||||
new_output(struct wl_listener *listener, void *data)
|
new_output(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, new_output);
|
||||||
new_output);
|
|
||||||
struct wlr_output *wlr_output = data;
|
struct wlr_output *wlr_output = data;
|
||||||
|
|
||||||
wlr_output_init_render(wlr_output, server->allocator, server->renderer);
|
wlr_output_init_render(wlr_output, server->allocator, server->renderer);
|
||||||
@@ -43,7 +42,7 @@ new_output(struct wl_listener *listener, void *data)
|
|||||||
wlr_output_commit_state(wlr_output, &state);
|
wlr_output_commit_state(wlr_output, &state);
|
||||||
wlr_output_state_finish(&state);
|
wlr_output_state_finish(&state);
|
||||||
|
|
||||||
struct absinthe_output *output = calloc(1, sizeof(*output));
|
struct absn_output *output = calloc(1, sizeof(*output));
|
||||||
output->wlr = wlr_output;
|
output->wlr = wlr_output;
|
||||||
output->server = server;
|
output->server = server;
|
||||||
|
|
||||||
@@ -63,18 +62,18 @@ new_output(struct wl_listener *listener, void *data)
|
|||||||
wlr_output_layout_get_box(server->output_layout, output->wlr,
|
wlr_output_layout_get_box(server->output_layout, output->wlr,
|
||||||
&output->geom);
|
&output->geom);
|
||||||
|
|
||||||
output->mstack_size = MSTACK_SIZE;
|
output->mstack_count = MSTACK_SIZE;
|
||||||
output->mstack_width = MSTACK_WIDTH;
|
output->mstack_width = MSTACK_WIDTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
new_xdg_toplevel(struct wl_listener *listener, void *data)
|
new_xdg_toplevel(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server,
|
||||||
new_xdg_toplevel);
|
new_xdg_toplevel);
|
||||||
struct wlr_xdg_toplevel *xdg_toplevel = data;
|
struct wlr_xdg_toplevel *xdg_toplevel = data;
|
||||||
|
|
||||||
struct absinthe_toplevel *toplevel = calloc(1, sizeof(*toplevel));
|
absn_toplevel *toplevel = calloc(1, sizeof(*toplevel));
|
||||||
toplevel->type = TOPLEVEL_XDG;
|
toplevel->type = TOPLEVEL_XDG;
|
||||||
toplevel->server = server;
|
toplevel->server = server;
|
||||||
toplevel->xdg = xdg_toplevel;
|
toplevel->xdg = xdg_toplevel;
|
||||||
@@ -103,16 +102,15 @@ new_xdg_toplevel(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
new_xdg_popup(struct wl_listener *listener, void *data)
|
new_xdg_popup(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, new_xdg_popup);
|
||||||
new_xdg_popup);
|
|
||||||
struct wlr_xdg_popup *xdg_popup = data;
|
struct wlr_xdg_popup *xdg_popup = data;
|
||||||
|
|
||||||
struct absinthe_popup *popup = calloc(1, sizeof(*popup));
|
absn_popup *popup = calloc(1, sizeof(*popup));
|
||||||
popup->wlr = xdg_popup;
|
popup->wlr = xdg_popup;
|
||||||
|
|
||||||
struct wlr_xdg_surface *parent = wlr_xdg_surface_try_from_wlr_surface(
|
struct wlr_xdg_surface *parent = wlr_xdg_surface_try_from_wlr_surface(
|
||||||
xdg_popup->parent);
|
xdg_popup->parent);
|
||||||
struct absinthe_toplevel *parent_toplevel = parent->data;
|
absn_toplevel *parent_toplevel = parent->data;
|
||||||
struct wlr_scene_tree *parent_tree = parent_toplevel->scene_tree;
|
struct wlr_scene_tree *parent_tree = parent_toplevel->scene_tree;
|
||||||
xdg_popup->base->data = wlr_scene_xdg_surface_create(parent_tree,
|
xdg_popup->base->data = wlr_scene_xdg_surface_create(parent_tree,
|
||||||
xdg_popup->base);
|
xdg_popup->base);
|
||||||
@@ -128,7 +126,7 @@ new_xdg_decoration(struct wl_listener *listener, void *data)
|
|||||||
{
|
{
|
||||||
UNUSED(listener);
|
UNUSED(listener);
|
||||||
struct wlr_xdg_toplevel_decoration_v1 *deco = data;
|
struct wlr_xdg_toplevel_decoration_v1 *deco = data;
|
||||||
struct absinthe_toplevel *toplevel = deco->toplevel->base->data;
|
absn_toplevel *toplevel = deco->toplevel->base->data;
|
||||||
toplevel->deco = deco;
|
toplevel->deco = deco;
|
||||||
|
|
||||||
LISTEN(toplevel->deco_request_mode, deco_request_mode,
|
LISTEN(toplevel->deco_request_mode, deco_request_mode,
|
||||||
@@ -142,7 +140,7 @@ new_xdg_decoration(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
new_layer_surface(struct wl_listener *listener, void *data)
|
new_layer_surface(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server,
|
||||||
new_layer_surface);
|
new_layer_surface);
|
||||||
struct wlr_layer_surface_v1 *layer_surface = data;
|
struct wlr_layer_surface_v1 *layer_surface = data;
|
||||||
|
|
||||||
@@ -152,7 +150,7 @@ new_layer_surface(struct wl_listener *listener, void *data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct absinthe_layer_surface *layer = calloc(1, sizeof(*layer));
|
absn_layer_surface *layer = calloc(1, sizeof(*layer));
|
||||||
LISTEN(layer->commit, layer_surface_commit,
|
LISTEN(layer->commit, layer_surface_commit,
|
||||||
layer_surface->surface->events.commit);
|
layer_surface->surface->events.commit);
|
||||||
LISTEN(layer->unmap, layer_surface_unmap,
|
LISTEN(layer->unmap, layer_surface_unmap,
|
||||||
@@ -166,8 +164,7 @@ void
|
|||||||
xwayland_ready(struct wl_listener *listener, void *data)
|
xwayland_ready(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, xw_ready);
|
||||||
xw_ready);
|
|
||||||
|
|
||||||
wlr_xwayland_set_seat(server->xwayland, server->seat);
|
wlr_xwayland_set_seat(server->xwayland, server->seat);
|
||||||
|
|
||||||
@@ -185,10 +182,9 @@ xwayland_ready(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
xwayland_new_surface(struct wl_listener *listener, void *data)
|
xwayland_new_surface(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, xw_new_surface);
|
||||||
xw_new_surface);
|
|
||||||
struct wlr_xwayland_surface *surface = data;
|
struct wlr_xwayland_surface *surface = data;
|
||||||
struct absinthe_toplevel *toplevel = calloc(1, sizeof(*toplevel));
|
absn_toplevel *toplevel = calloc(1, sizeof(*toplevel));
|
||||||
|
|
||||||
toplevel->type = TOPLEVEL_X11;
|
toplevel->type = TOPLEVEL_X11;
|
||||||
toplevel->server = server;
|
toplevel->server = server;
|
||||||
@@ -218,8 +214,7 @@ xwayland_new_surface(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
cursor_motion(struct wl_listener *listener, void *data)
|
cursor_motion(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, cursor_motion);
|
||||||
cursor_motion);
|
|
||||||
struct wlr_pointer_motion_event *event = data;
|
struct wlr_pointer_motion_event *event = data;
|
||||||
update_focused_output(server);
|
update_focused_output(server);
|
||||||
wlr_cursor_move(server->cursor, &event->pointer->base, event->delta_x,
|
wlr_cursor_move(server->cursor, &event->pointer->base, event->delta_x,
|
||||||
@@ -230,7 +225,7 @@ cursor_motion(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
cursor_motion_abs(struct wl_listener *listener, void *data)
|
cursor_motion_abs(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server,
|
||||||
cursor_motion_abs);
|
cursor_motion_abs);
|
||||||
struct wlr_pointer_motion_absolute_event *event = data;
|
struct wlr_pointer_motion_absolute_event *event = data;
|
||||||
update_focused_output(server);
|
update_focused_output(server);
|
||||||
@@ -242,8 +237,7 @@ cursor_motion_abs(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
cursor_button(struct wl_listener *listener, void *data)
|
cursor_button(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, cursor_button);
|
||||||
cursor_button);
|
|
||||||
struct wlr_pointer_button_event *event = data;
|
struct wlr_pointer_button_event *event = data;
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
|
|
||||||
@@ -252,8 +246,8 @@ cursor_button(struct wl_listener *listener, void *data)
|
|||||||
} else {
|
} else {
|
||||||
double sx, sy;
|
double sx, sy;
|
||||||
struct wlr_surface *surface = NULL;
|
struct wlr_surface *surface = NULL;
|
||||||
struct absinthe_toplevel *toplevel = toplevel_at(server,
|
absn_toplevel *toplevel = toplevel_at(server, server->cursor->x,
|
||||||
server->cursor->x, server->cursor->y, &surface, &sx, &sy);
|
server->cursor->y, &surface, &sx, &sy);
|
||||||
|
|
||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
goto handle;
|
goto handle;
|
||||||
@@ -324,8 +318,7 @@ handle:
|
|||||||
void
|
void
|
||||||
cursor_axis(struct wl_listener *listener, void *data)
|
cursor_axis(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, cursor_axis);
|
||||||
cursor_axis);
|
|
||||||
struct wlr_pointer_axis_event *event = data;
|
struct wlr_pointer_axis_event *event = data;
|
||||||
wlr_seat_pointer_notify_axis(server->seat, event->time_msec,
|
wlr_seat_pointer_notify_axis(server->seat, event->time_msec,
|
||||||
event->orientation, event->delta, event->delta_discrete,
|
event->orientation, event->delta, event->delta_discrete,
|
||||||
@@ -336,17 +329,16 @@ void
|
|||||||
cursor_frame(struct wl_listener *listener, void *data)
|
cursor_frame(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, cursor_frame);
|
||||||
cursor_frame);
|
|
||||||
wlr_seat_pointer_notify_frame(server->seat);
|
wlr_seat_pointer_notify_frame(server->seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
new_keyboard(struct absinthe_server *server, struct wlr_input_device *device)
|
new_keyboard(absn_server *server, struct wlr_input_device *device)
|
||||||
{
|
{
|
||||||
struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(
|
struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(
|
||||||
device);
|
device);
|
||||||
struct absinthe_keyboard *keyboard = calloc(1, sizeof(*keyboard));
|
absn_keyboard *keyboard = calloc(1, sizeof(*keyboard));
|
||||||
keyboard->server = server;
|
keyboard->server = server;
|
||||||
keyboard->wlr = wlr_keyboard;
|
keyboard->wlr = wlr_keyboard;
|
||||||
|
|
||||||
@@ -371,7 +363,7 @@ new_keyboard(struct absinthe_server *server, struct wlr_input_device *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
new_pointer(struct absinthe_server *server, struct wlr_input_device *device)
|
new_pointer(absn_server *server, struct wlr_input_device *device)
|
||||||
{
|
{
|
||||||
wlr_cursor_attach_input_device(server->cursor, device);
|
wlr_cursor_attach_input_device(server->cursor, device);
|
||||||
}
|
}
|
||||||
@@ -379,8 +371,7 @@ new_pointer(struct absinthe_server *server, struct wlr_input_device *device)
|
|||||||
void
|
void
|
||||||
new_input(struct wl_listener *listener, void *data)
|
new_input(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct absinthe_server *server = wl_container_of(listener, server,
|
absn_server *server = wl_container_of(listener, server, new_input);
|
||||||
new_input);
|
|
||||||
struct wlr_input_device *device = data;
|
struct wlr_input_device *device = data;
|
||||||
switch (device->type) {
|
switch (device->type) {
|
||||||
case WLR_INPUT_DEVICE_KEYBOARD:
|
case WLR_INPUT_DEVICE_KEYBOARD:
|
||||||
|
|||||||
+8
-11
@@ -11,8 +11,7 @@ void
|
|||||||
toplevel_map(struct wl_listener *listener, void *data)
|
toplevel_map(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel, map);
|
||||||
map);
|
|
||||||
|
|
||||||
toplevel->scene_tree = wlr_scene_tree_create(
|
toplevel->scene_tree = wlr_scene_tree_create(
|
||||||
&toplevel->server->scene->tree);
|
&toplevel->server->scene->tree);
|
||||||
@@ -46,7 +45,7 @@ toplevel_map(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
toplevel->scene_surface->node.data = toplevel;
|
toplevel->scene_surface->node.data = toplevel;
|
||||||
|
|
||||||
toplevel_update_geom(toplevel);
|
toplevel_get_geom(toplevel);
|
||||||
toplevel->bw = toplevel_is_unmanaged(toplevel) ? 0 : TOPLEVEL_BW;
|
toplevel->bw = toplevel_is_unmanaged(toplevel) ? 0 : TOPLEVEL_BW;
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
@@ -70,8 +69,7 @@ void
|
|||||||
toplevel_unmap(struct wl_listener *listener, void *data)
|
toplevel_unmap(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel, unmap);
|
||||||
unmap);
|
|
||||||
|
|
||||||
if (toplevel == toplevel->server->focused_toplevel) {
|
if (toplevel == toplevel->server->focused_toplevel) {
|
||||||
toplevel->server->focused_toplevel = NULL;
|
toplevel->server->focused_toplevel = NULL;
|
||||||
@@ -91,8 +89,7 @@ void
|
|||||||
toplevel_destroy(struct wl_listener *listener, void *data)
|
toplevel_destroy(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel, destroy);
|
||||||
destroy);
|
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (toplevel->type == TOPLEVEL_X11) {
|
if (toplevel->type == TOPLEVEL_X11) {
|
||||||
@@ -122,7 +119,7 @@ void
|
|||||||
toplevel_request_move(struct wl_listener *listener, void *data)
|
toplevel_request_move(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
request_move);
|
request_move);
|
||||||
if (toplevel->xdg->base->initialized)
|
if (toplevel->xdg->base->initialized)
|
||||||
wlr_xdg_surface_schedule_configure(toplevel->xdg->base);
|
wlr_xdg_surface_schedule_configure(toplevel->xdg->base);
|
||||||
@@ -132,7 +129,7 @@ void
|
|||||||
toplevel_request_resize(struct wl_listener *listener, void *data)
|
toplevel_request_resize(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
request_resize);
|
request_resize);
|
||||||
if (toplevel->xdg->base->initialized)
|
if (toplevel->xdg->base->initialized)
|
||||||
wlr_xdg_surface_schedule_configure(toplevel->xdg->base);
|
wlr_xdg_surface_schedule_configure(toplevel->xdg->base);
|
||||||
@@ -142,7 +139,7 @@ void
|
|||||||
toplevel_request_maximize(struct wl_listener *listener, void *data)
|
toplevel_request_maximize(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
request_maximize);
|
request_maximize);
|
||||||
if (toplevel->xdg->base->initialized)
|
if (toplevel->xdg->base->initialized)
|
||||||
wlr_xdg_surface_schedule_configure(toplevel->xdg->base);
|
wlr_xdg_surface_schedule_configure(toplevel->xdg->base);
|
||||||
@@ -152,7 +149,7 @@ void
|
|||||||
toplevel_request_fullscreen(struct wl_listener *listener, void *data)
|
toplevel_request_fullscreen(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
request_fullscreen);
|
request_fullscreen);
|
||||||
toplevel_set_fullscreen(toplevel, toplevel->xdg->requested.fullscreen);
|
toplevel_set_fullscreen(toplevel, toplevel->xdg->requested.fullscreen);
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-22
@@ -6,8 +6,13 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "xdg-shell-protocol.h"
|
#include "xdg-shell-protocol.h"
|
||||||
|
|
||||||
struct absinthe_toplevel *
|
/*
|
||||||
toplevel_at(struct absinthe_server *server, double lx, double ly,
|
* returns toplevel at given cursor coordinates,
|
||||||
|
* its surface and coordinates inside of it
|
||||||
|
* to process input event
|
||||||
|
*/
|
||||||
|
absn_toplevel *
|
||||||
|
toplevel_at(absn_server *server, double lx, double ly,
|
||||||
struct wlr_surface **surface, double *sx, double *sy)
|
struct wlr_surface **surface, double *sx, double *sy)
|
||||||
{
|
{
|
||||||
struct wlr_scene_node *node =
|
struct wlr_scene_node *node =
|
||||||
@@ -41,8 +46,13 @@ toplevel_at(struct absinthe_server *server, double lx, double ly,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* if toplevel is unmanaged we should not
|
||||||
|
* move or resize it and just draw it
|
||||||
|
* where it wants
|
||||||
|
*/
|
||||||
bool
|
bool
|
||||||
toplevel_is_unmanaged(struct absinthe_toplevel *toplevel)
|
toplevel_is_unmanaged(absn_toplevel *toplevel)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (toplevel->type == TOPLEVEL_X11)
|
if (toplevel->type == TOPLEVEL_X11)
|
||||||
@@ -51,8 +61,9 @@ toplevel_is_unmanaged(struct absinthe_toplevel *toplevel)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* used only to get initial window size */
|
||||||
void
|
void
|
||||||
toplevel_update_geom(struct absinthe_toplevel *toplevel)
|
toplevel_get_geom(absn_toplevel *toplevel)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (toplevel->type == TOPLEVEL_X11) {
|
if (toplevel->type == TOPLEVEL_X11) {
|
||||||
@@ -67,8 +78,8 @@ toplevel_update_geom(struct absinthe_toplevel *toplevel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
toplevel_update_borders_geom(struct absinthe_toplevel *toplevel)
|
toplevel_update_borders_geom(absn_toplevel *toplevel)
|
||||||
{
|
{
|
||||||
int32_t bw = toplevel->bw;
|
int32_t bw = toplevel->bw;
|
||||||
|
|
||||||
@@ -96,7 +107,7 @@ toplevel_update_borders_geom(struct absinthe_toplevel *toplevel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
toplevel_set_pos(struct absinthe_toplevel *toplevel, int32_t x, int32_t y)
|
toplevel_set_pos(absn_toplevel *toplevel, int32_t x, int32_t y)
|
||||||
{
|
{
|
||||||
toplevel->geom.x = x;
|
toplevel->geom.x = x;
|
||||||
toplevel->geom.y = y;
|
toplevel->geom.y = y;
|
||||||
@@ -104,8 +115,7 @@ toplevel_set_pos(struct absinthe_toplevel *toplevel, int32_t x, int32_t y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
toplevel_set_size(struct absinthe_toplevel *toplevel, int32_t width,
|
toplevel_set_size(absn_toplevel *toplevel, int32_t width, int32_t height)
|
||||||
int32_t height)
|
|
||||||
{
|
{
|
||||||
if (width <= 2 * toplevel->bw || height <= 2 * toplevel->bw ||
|
if (width <= 2 * toplevel->bw || height <= 2 * toplevel->bw ||
|
||||||
(width == toplevel->geom.width && height == toplevel->geom.height))
|
(width == toplevel->geom.width && height == toplevel->geom.height))
|
||||||
@@ -129,8 +139,6 @@ toplevel_set_size(struct absinthe_toplevel *toplevel, int32_t width,
|
|||||||
height);
|
height);
|
||||||
toplevel->resizing = wlr_xdg_toplevel_set_size(toplevel->xdg,
|
toplevel->resizing = wlr_xdg_toplevel_set_size(toplevel->xdg,
|
||||||
width - 2 * toplevel->bw, height - 2 * toplevel->bw);
|
width - 2 * toplevel->bw, height - 2 * toplevel->bw);
|
||||||
// clip.x = toplevel->xdg->base->geometry.x;
|
|
||||||
// clip.y = toplevel->xdg->base->geometry.y;
|
|
||||||
}
|
}
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
else if (toplevel->type == TOPLEVEL_X11) {
|
else if (toplevel->type == TOPLEVEL_X11) {
|
||||||
@@ -147,36 +155,37 @@ toplevel_set_size(struct absinthe_toplevel *toplevel, int32_t width,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
toplevel_set_fullscreen(struct absinthe_toplevel *toplevel, bool fullscreen)
|
toplevel_set_geom(absn_toplevel *toplevel, struct wlr_box *geom)
|
||||||
|
{
|
||||||
|
toplevel_set_pos(toplevel, geom->x, geom->y);
|
||||||
|
toplevel_set_size(toplevel, geom->width, geom->height);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
toplevel_set_fullscreen(absn_toplevel *toplevel, bool fullscreen)
|
||||||
{
|
{
|
||||||
if (!toplevel || toplevel->fullscreen == fullscreen)
|
if (!toplevel || toplevel->fullscreen == fullscreen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct absinthe_output *output = toplevel->server->focused_output;
|
absn_output *output = toplevel->server->focused_output;
|
||||||
toplevel->fullscreen = fullscreen;
|
toplevel->fullscreen = fullscreen;
|
||||||
wlr_xdg_toplevel_set_fullscreen(toplevel->xdg, fullscreen);
|
wlr_xdg_toplevel_set_fullscreen(toplevel->xdg, fullscreen);
|
||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
toplevel->prev_geom = toplevel->geom;
|
toplevel->prev_geom = toplevel->geom;
|
||||||
toplevel->bw = 0;
|
toplevel->bw = 0;
|
||||||
toplevel_set_size(toplevel, output->geom.width,
|
toplevel_set_geom(toplevel, &output->geom);
|
||||||
output->geom.height);
|
|
||||||
toplevel_set_pos(toplevel, output->geom.x, output->geom.y);
|
|
||||||
} else {
|
} else {
|
||||||
toplevel->bw = toplevel_is_unmanaged(toplevel) ? 0 :
|
toplevel->bw = toplevel_is_unmanaged(toplevel) ? 0 :
|
||||||
TOPLEVEL_BW;
|
TOPLEVEL_BW;
|
||||||
toplevel_set_size(toplevel, toplevel->prev_geom.width,
|
toplevel_set_geom(toplevel, &toplevel->prev_geom);
|
||||||
toplevel->prev_geom.height);
|
|
||||||
toplevel_set_pos(toplevel, toplevel->prev_geom.x,
|
|
||||||
toplevel->prev_geom.y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toplevel_update_borders_geom(toplevel);
|
toplevel_update_borders_geom(toplevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
toplevel_set_border_color(struct absinthe_toplevel *toplevel,
|
toplevel_set_border_color(absn_toplevel *toplevel, const float color[4])
|
||||||
const float color[4])
|
|
||||||
{
|
{
|
||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ void
|
|||||||
deco_request_mode(struct wl_listener *listener, void *data)
|
deco_request_mode(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
deco_request_mode);
|
deco_request_mode);
|
||||||
if (toplevel->xdg->base->initialized)
|
if (toplevel->xdg->base->initialized)
|
||||||
wlr_xdg_toplevel_decoration_v1_set_mode(toplevel->deco,
|
wlr_xdg_toplevel_decoration_v1_set_mode(toplevel->deco,
|
||||||
@@ -17,7 +17,7 @@ void
|
|||||||
deco_destroy(struct wl_listener *listener, void *data)
|
deco_destroy(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
deco_destroy);
|
deco_destroy);
|
||||||
|
|
||||||
wl_list_remove(&toplevel->deco_request_mode.link);
|
wl_list_remove(&toplevel->deco_request_mode.link);
|
||||||
|
|||||||
+2
-3
@@ -7,7 +7,7 @@ void
|
|||||||
xdg_popup_commit(struct wl_listener *listener, void *data)
|
xdg_popup_commit(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_popup *popup = wl_container_of(listener, popup, commit);
|
absn_popup *popup = wl_container_of(listener, popup, commit);
|
||||||
|
|
||||||
if (popup->wlr->base->initial_commit)
|
if (popup->wlr->base->initial_commit)
|
||||||
wlr_xdg_surface_schedule_configure(popup->wlr->base);
|
wlr_xdg_surface_schedule_configure(popup->wlr->base);
|
||||||
@@ -17,8 +17,7 @@ void
|
|||||||
xdg_popup_destroy(struct wl_listener *listener, void *data)
|
xdg_popup_destroy(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_popup *popup = wl_container_of(listener, popup,
|
absn_popup *popup = wl_container_of(listener, popup, destroy);
|
||||||
destroy);
|
|
||||||
|
|
||||||
wl_list_remove(&popup->commit.link);
|
wl_list_remove(&popup->commit.link);
|
||||||
wl_list_remove(&popup->destroy.link);
|
wl_list_remove(&popup->destroy.link);
|
||||||
|
|||||||
+1
-2
@@ -9,8 +9,7 @@ void
|
|||||||
toplevel_commit(struct wl_listener *listener, void *data)
|
toplevel_commit(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel, commit);
|
||||||
commit);
|
|
||||||
|
|
||||||
if (toplevel->xdg->base->initial_commit) {
|
if (toplevel->xdg->base->initial_commit) {
|
||||||
wlr_xdg_toplevel_set_activated(toplevel->xdg, false);
|
wlr_xdg_toplevel_set_activated(toplevel->xdg, false);
|
||||||
|
|||||||
+4
-4
@@ -9,7 +9,7 @@ void
|
|||||||
xwayland_activate(struct wl_listener *listener, void *data)
|
xwayland_activate(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
xw_activate);
|
xw_activate);
|
||||||
|
|
||||||
if (!toplevel_is_unmanaged(toplevel))
|
if (!toplevel_is_unmanaged(toplevel))
|
||||||
@@ -20,7 +20,7 @@ void
|
|||||||
xwayland_associate(struct wl_listener *listener, void *data)
|
xwayland_associate(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
xw_associate);
|
xw_associate);
|
||||||
|
|
||||||
LISTEN(toplevel->map, toplevel_map, toplevel->xw->surface->events.map);
|
LISTEN(toplevel->map, toplevel_map, toplevel->xw->surface->events.map);
|
||||||
@@ -32,7 +32,7 @@ void
|
|||||||
xwayland_dissociate(struct wl_listener *listener, void *data)
|
xwayland_dissociate(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
xw_dissociate);
|
xw_dissociate);
|
||||||
|
|
||||||
wl_list_remove(&toplevel->map.link);
|
wl_list_remove(&toplevel->map.link);
|
||||||
@@ -43,7 +43,7 @@ void
|
|||||||
xwayland_configure(struct wl_listener *listener, void *data)
|
xwayland_configure(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
UNUSED(data);
|
UNUSED(data);
|
||||||
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel,
|
absn_toplevel *toplevel = wl_container_of(listener, toplevel,
|
||||||
xw_configure);
|
xw_configure);
|
||||||
struct wlr_xwayland_surface_configure_event *event = data;
|
struct wlr_xwayland_surface_configure_event *event = data;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user