mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
feat: The floating Windows do not overlap
This commit is contained in:
parent
df96f252b7
commit
40a1135c9e
1 changed files with 23 additions and 0 deletions
23
src/mango.c
23
src/mango.c
|
|
@ -700,6 +700,7 @@ static bool check_trackpad_disabled(struct wlr_pointer *pointer);
|
||||||
static unsigned int get_tag_status(unsigned int tag, Monitor *m);
|
static unsigned int get_tag_status(unsigned int tag, Monitor *m);
|
||||||
static void enable_adaptive_sync(Monitor *m, struct wlr_output_state *state);
|
static void enable_adaptive_sync(Monitor *m, struct wlr_output_state *state);
|
||||||
static Client *get_next_stack_client(Client *c, bool reverse);
|
static Client *get_next_stack_client(Client *c, bool reverse);
|
||||||
|
static void set_float_malposition(Client *tc);
|
||||||
|
|
||||||
#include "data/static_keymap.h"
|
#include "data/static_keymap.h"
|
||||||
#include "dispatch/bind_declare.h"
|
#include "dispatch/bind_declare.h"
|
||||||
|
|
@ -1179,6 +1180,24 @@ int applyrulesgeom(Client *c) {
|
||||||
return hit;
|
return hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_float_malposition(Client *tc) {
|
||||||
|
Client *c = NULL;
|
||||||
|
int x, y;
|
||||||
|
x = tc->geom.x;
|
||||||
|
y = tc->geom.y;
|
||||||
|
|
||||||
|
wl_list_for_each(c, &clients, link) {
|
||||||
|
if (c->isfloating && c != tc && VISIBLEON(c, tc->mon) &&
|
||||||
|
x - c->geom.x < 50 && y - c->geom.y < 50) {
|
||||||
|
x = c->geom.x + 50;
|
||||||
|
y = c->geom.y + 50;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tc->float_geom.x = tc->geom.x = x;
|
||||||
|
tc->float_geom.y = tc->geom.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
void applyrules(Client *c) {
|
void applyrules(Client *c) {
|
||||||
/* rule matching */
|
/* rule matching */
|
||||||
const char *appid, *title;
|
const char *appid, *title;
|
||||||
|
|
@ -1298,6 +1317,10 @@ void applyrules(Client *c) {
|
||||||
arrange(c->mon, false);
|
arrange(c->mon, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c->isfloating && !hit_rule_pos) {
|
||||||
|
set_float_malposition(c);
|
||||||
|
}
|
||||||
|
|
||||||
// apply named scratchpad rule
|
// apply named scratchpad rule
|
||||||
if (c->isnamedscratchpad) {
|
if (c->isnamedscratchpad) {
|
||||||
apply_named_scratchpad(c);
|
apply_named_scratchpad(c);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue