Compare commits

...

4 commits

Author SHA1 Message Date
DreamMaoMao
31f376f998 opt: allow switch focus between fullscreen and floating window in focusstack 2025-10-27 12:46:46 +08:00
DreamMaoMao
9b5f05e718 opt: delay 1ms before exit when mmsg send request 2025-10-27 12:29:50 +08:00
DreamMaoMao
2d3b89e23d opt: only find same monitor when find same x and same y client 2025-10-26 18:11:52 +08:00
DreamMaoMao
fd00828567 update readme 2025-10-26 18:11:36 +08:00
6 changed files with 33 additions and 8 deletions

View file

@ -32,6 +32,14 @@ Scroller Layout
https://github.com/user-attachments/assets/c9bf9415-fad1-4400-bcdc-3ad2d76de85a
Layer animaiton
https://github.com/user-attachments/assets/014c893f-115c-4ae9-8342-f9ae3e9a0df0
# Our discord
[mangowc](https://discord.gg/CPjbDxesh5)
# Supported layouts
- tile

View file

@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <wayland-client.h>
#include <wayland-util.h>
@ -373,6 +374,7 @@ static void dwl_ipc_output_frame(void *data,
dispatch_arg3, dispatch_arg4, dispatch_arg5);
}
wl_display_flush(display);
usleep(1000);
exit(0);
} else {
if (tflag) {

View file

@ -213,7 +213,7 @@ int focusstack(const Arg *arg) {
Client *sel = focustop(selmon);
Client *tc = NULL;
if (!sel || (sel->isfullscreen && !client_has_children(sel)))
if (!sel)
return 0;
if (arg->i == NEXT) {
tc = get_next_stack_client(sel, false);

View file

@ -150,7 +150,7 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
// 第一次遍历,计算客户端数量
wl_list_for_each(c, &clients, link) {
if (c && (findfloating || !c->isfloating) && !c->isunglobal &&
(focus_cross_monitor || c->mon == selmon) &&
(focus_cross_monitor || c->mon == tc->mon) &&
(c->tags & c->mon->tagset[c->mon->seltags])) {
last++;
}
@ -171,7 +171,7 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
last = -1;
wl_list_for_each(c, &clients, link) {
if (c && (findfloating || !c->isfloating) && !c->isunglobal &&
(focus_cross_monitor || c->mon == selmon) &&
(focus_cross_monitor || c->mon == tc->mon) &&
(c->tags & c->mon->tagset[c->mon->seltags])) {
last++;
tempClients[last] = c;
@ -187,7 +187,8 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
case UP:
for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.y < sel_y &&
tempClients[_i]->geom.x == sel_x) {
tempClients[_i]->geom.x == sel_x &&
tempClients[_i]->mon == tc->mon) {
int dis_x = tempClients[_i]->geom.x - sel_x;
int dis_y = tempClients[_i]->geom.y - sel_y;
long long int tmp_distance =
@ -216,7 +217,8 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
case DOWN:
for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.y > sel_y &&
tempClients[_i]->geom.x == sel_x) {
tempClients[_i]->geom.x == sel_x &&
tempClients[_i]->mon == tc->mon) {
int dis_x = tempClients[_i]->geom.x - sel_x;
int dis_y = tempClients[_i]->geom.y - sel_y;
long long int tmp_distance =
@ -245,7 +247,8 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
case LEFT:
for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.x < sel_x &&
tempClients[_i]->geom.y == sel_y) {
tempClients[_i]->geom.y == sel_y &&
tempClients[_i]->mon == tc->mon) {
int dis_x = tempClients[_i]->geom.x - sel_x;
int dis_y = tempClients[_i]->geom.y - sel_y;
long long int tmp_distance =
@ -274,7 +277,8 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
case RIGHT:
for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.x > sel_x &&
tempClients[_i]->geom.y == sel_y) {
tempClients[_i]->geom.y == sel_y &&
tempClients[_i]->mon == tc->mon) {
int dis_x = tempClients[_i]->geom.x - sel_x;
int dis_y = tempClients[_i]->geom.y - sel_y;
long long int tmp_distance =
@ -339,11 +343,17 @@ Client *get_next_stack_client(Client *c, bool reverse) {
Client *next = NULL;
if (reverse) {
wl_list_for_each_reverse(next, &c->link, link) {
if (c->mon->has_visible_fullscreen_client && !next->isfloating &&
!next->isfullscreen)
continue;
if (VISIBLEON(next, c->mon) && next != c)
return next;
}
} else {
wl_list_for_each(next, &c->link, link) {
if (c->mon->has_visible_fullscreen_client && !next->isfloating &&
!next->isfullscreen)
continue;
if (VISIBLEON(next, c->mon) && next != c)
return next;
}

View file

@ -592,6 +592,7 @@ arrange(Monitor *m, bool want_animation) {
return;
m->visible_clients = 0;
m->visible_tiling_clients = 0;
m->has_visible_fullscreen_client = false;
wl_list_for_each(c, &clients, link) {
@ -603,6 +604,10 @@ arrange(Monitor *m, bool want_animation) {
if (VISIBLEON(c, m)) {
m->visible_clients++;
if (c->isfullscreen)
m->has_visible_fullscreen_client = true;
if (ISTILED(c)) {
m->visible_tiling_clients++;
}

View file

@ -440,6 +440,7 @@ struct Monitor {
int asleep;
unsigned int visible_clients;
unsigned int visible_tiling_clients;
bool has_visible_fullscreen_client;
char last_surface_ws_name[256];
struct wlr_ext_workspace_group_handle_v1 *ext_group;
};
@ -4469,7 +4470,6 @@ void setfullscreen(Client *c, int fullscreen) // 用自定义全屏代理自带
wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
resize(c, c->mon->m, 1);
c->isfullscreen = 1;
// c->isfloating = 0;
} else {
c->bw = c->isnoborder ? 0 : borderpx;
c->isfullscreen = 0;