mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-31 22:25:29 -04:00
feat: wlr-ext-workspace support
This commit is contained in:
parent
ac05b63718
commit
2cf164aaab
5 changed files with 218 additions and 4 deletions
31
src/mango.c
31
src/mango.c
|
|
@ -422,6 +422,7 @@ struct Monitor {
|
|||
unsigned int visible_tiling_clients;
|
||||
struct wlr_scene_optimized_blur *blur;
|
||||
char last_surface_ws_name[256];
|
||||
struct wlr_ext_workspace_group_handle_v1 *ext_group;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -640,6 +641,7 @@ static bool check_hit_no_border(Client *c);
|
|||
static void reset_keyboard_layout(void);
|
||||
static void client_update_oldmonname_record(Client *c, Monitor *m);
|
||||
static void pending_kill_client(Client *c);
|
||||
static unsigned int get_tags_first_tag_num(unsigned int source_tags);
|
||||
static void set_layer_open_animaiton(LayerSurface *l, struct wlr_box geo);
|
||||
static void init_fadeout_layers(LayerSurface *l);
|
||||
static void layer_actual_size(LayerSurface *l, unsigned int *width,
|
||||
|
|
@ -1969,6 +1971,11 @@ void cleanupmon(struct wl_listener *listener, void *data) {
|
|||
wlr_layer_surface_v1_destroy(l->layer_surface);
|
||||
}
|
||||
|
||||
// clean ext-workspaces grouplab
|
||||
wlr_ext_workspace_group_handle_v1_output_leave(m->ext_group, m->wlr_output);
|
||||
wlr_ext_workspace_group_handle_v1_destroy(m->ext_group);
|
||||
cleanup_workspaces_by_monitor(m);
|
||||
|
||||
wl_list_remove(&m->destroy.link);
|
||||
wl_list_remove(&m->frame.link);
|
||||
wl_list_remove(&m->link);
|
||||
|
|
@ -2538,8 +2545,6 @@ void createmon(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
}
|
||||
|
||||
printstatus();
|
||||
|
||||
/* The xdg-protocol specifies:
|
||||
*
|
||||
* If the fullscreened surface is not opaque, the compositor must make
|
||||
|
|
@ -2568,6 +2573,15 @@ void createmon(struct wl_listener *listener, void *data) {
|
|||
wlr_scene_optimized_blur_set_size(m->blur, m->m.width, m->m.height);
|
||||
// wlr_scene_node_set_enabled(&m->blur->node, 1);
|
||||
}
|
||||
m->ext_group = wlr_ext_workspace_group_handle_v1_create(
|
||||
ext_manager, WLR_EXT_WORKSPACE_HANDLE_V1_CAP_ACTIVATE);
|
||||
wlr_ext_workspace_group_handle_v1_output_enter(m->ext_group, m->wlr_output);
|
||||
|
||||
for (i = 1; i <= LENGTH(tags); i++) {
|
||||
add_workspace_by_tag(i, m);
|
||||
}
|
||||
|
||||
printstatus();
|
||||
}
|
||||
|
||||
void // fix for 0.5
|
||||
|
|
@ -3724,7 +3738,11 @@ printstatus(void) {
|
|||
if (!m->wlr_output->enabled) {
|
||||
continue;
|
||||
}
|
||||
dwl_ipc_output_printstatus(m); // 更新waybar上tag的状态 这里很关键
|
||||
// Update workspace active states
|
||||
dwl_ext_workspace_printstatus(m);
|
||||
|
||||
// Update IPC output status
|
||||
dwl_ipc_output_printstatus(m);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4607,6 +4625,9 @@ void setup(void) {
|
|||
wlr_xdg_foreign_registry_create(dpy);
|
||||
wlr_xdg_foreign_v1_create(dpy, foreign_registry);
|
||||
wlr_xdg_foreign_v2_create(dpy, foreign_registry);
|
||||
|
||||
// ext-workspace协议
|
||||
workspaces_init();
|
||||
#ifdef XWAYLAND
|
||||
/*
|
||||
* Initialise the XWayland X server.
|
||||
|
|
@ -4753,7 +4774,6 @@ int hidecursor(void *data) {
|
|||
|
||||
// 显示所有tag 或 跳转到聚焦窗口的tag
|
||||
void toggleoverview(const Arg *arg) {
|
||||
|
||||
Client *c;
|
||||
|
||||
if (selmon->isoverview && ov_tab_mode && arg->i != -1 && selmon->sel) {
|
||||
|
|
@ -4784,6 +4804,7 @@ void toggleoverview(const Arg *arg) {
|
|||
} else if (!selmon->isoverview && !selmon->sel) {
|
||||
target = (1 << (selmon->pertag->prevtag - 1));
|
||||
view(&(Arg){.ui = target}, false);
|
||||
refresh_monitors_workspaces_status(selmon);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -4809,6 +4830,8 @@ void toggleoverview(const Arg *arg) {
|
|||
if (ov_tab_mode && selmon->isoverview && selmon->sel) {
|
||||
focusstack(&(Arg){.i = 1});
|
||||
}
|
||||
|
||||
refresh_monitors_workspaces_status(selmon);
|
||||
}
|
||||
|
||||
void unlocksession(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue