mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-14 14:33:10 -04:00
Compare commits
No commits in common. "main" and "0.14.1" have entirely different histories.
14 changed files with 168 additions and 250 deletions
|
|
@ -21,7 +21,6 @@ description: Advanced settings for XWayland, focus behavior, and system integrat
|
||||||
| `sloppyfocus` | `1` | Focus follows the mouse cursor. |
|
| `sloppyfocus` | `1` | Focus follows the mouse cursor. |
|
||||||
| `warpcursor` | `1` | Warp the cursor to the center of the window when focus changes via keyboard. |
|
| `warpcursor` | `1` | Warp the cursor to the center of the window when focus changes via keyboard. |
|
||||||
| `cursor_hide_timeout` | `0` | Hide the cursor after `N` seconds of inactivity (`0` to disable). |
|
| `cursor_hide_timeout` | `0` | Hide the cursor after `N` seconds of inactivity (`0` to disable). |
|
||||||
| `cursor_hide_on_keypress` | `0` | Hide the cursor on keypress. |
|
|
||||||
| `drag_tile_to_tile` | `0` | Allow dragging a tiled window onto another to swap their positions. |
|
| `drag_tile_to_tile` | `0` | Allow dragging a tiled window onto another to swap their positions. |
|
||||||
| `drag_tile_small` | `1` | Allow dragging a tiled window temporarily to small size.|
|
| `drag_tile_small` | `1` | Allow dragging a tiled window temporarily to small size.|
|
||||||
| `drag_corner` | `3` | Corner for drag-to-tile detection (0: none, 1–3: corners, 4: auto-detect). |
|
| `drag_corner` | `3` | Corner for drag-to-tile detection (0: none, 1–3: corners, 4: auto-detect). |
|
||||||
|
|
|
||||||
|
|
@ -163,8 +163,6 @@ Some GPUs have compatibility issues with `syncobj_enable=1` — it may crash app
|
||||||
## Power Management
|
## Power Management
|
||||||
|
|
||||||
You can control monitor power using the `mmsg` IPC tool.
|
You can control monitor power using the `mmsg` IPC tool.
|
||||||
> Notice: This command does not remove the monitor, it only turns it off.
|
|
||||||
> if you want completely remove monitor, just use `wlr-randr`
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Turn off
|
# Turn off
|
||||||
|
|
@ -180,13 +178,13 @@ mmsg dispatch toggle_monitor,eDP-1
|
||||||
You can also use `wlr-randr` for monitor management:
|
You can also use `wlr-randr` for monitor management:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# remove a monitor
|
# Turn off monitor
|
||||||
wlr-randr --output eDP-1 --off
|
wlr-randr --output eDP-1 --off
|
||||||
|
|
||||||
# add a monitor
|
# Turn on monitor
|
||||||
wlr-randr --output eDP-1 --on
|
wlr-randr --output eDP-1 --on
|
||||||
|
|
||||||
# Show all monitors spec
|
# Show all monitors
|
||||||
wlr-randr
|
wlr-randr
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ Instead, compose your own workflow from small Wayland utilities and bind them to
|
||||||
| [`slurp`](https://github.com/emersion/slurp) | Interactively select a region for `grim` |
|
| [`slurp`](https://github.com/emersion/slurp) | Interactively select a region for `grim` |
|
||||||
| [`wl-copy`](https://github.com/bugaevc/wl-clipboard) | Copy screenshots directly to the clipboard |
|
| [`wl-copy`](https://github.com/bugaevc/wl-clipboard) | Copy screenshots directly to the clipboard |
|
||||||
| [`satty`](https://github.com/gabm/Satty) | Annotate screenshots before saving |
|
| [`satty`](https://github.com/gabm/Satty) | Annotate screenshots before saving |
|
||||||
| [`wayfreeze`](https://github.com/Jappie3/wayfreeze) | Freeze the screen before capture |
|
| [`wayfreeze`](https://github.com/nicbk/wayfreeze) | Freeze the screen before capture |
|
||||||
|
|
||||||
Install the required with your package manager or from source.
|
Install the required with your package manager or from source.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ windowrule=width:1000,height:900,appid:yesplaymusic,title:Demons
|
||||||
|
|
||||||
# Global keybindings for OBS Studio
|
# Global keybindings for OBS Studio
|
||||||
windowrule=globalkeybinding:ctrl+alt-o,appid:com.obsproject.Studio
|
windowrule=globalkeybinding:ctrl+alt-o,appid:com.obsproject.Studio
|
||||||
windowrule=globalkeybinding:ctrl+alt-n,appid:com.obsproject.Studio
|
windowrule=globalkeybinding:ctrl+alt+n,appid:com.obsproject.Studio
|
||||||
windowrule=isopensilent:1,appid:com.obsproject.Studio
|
windowrule=isopensilent:1,appid:com.obsproject.Studio
|
||||||
|
|
||||||
# Force tearing for games
|
# Force tearing for games
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
project('mango', ['c'],
|
project('mango', ['c'],
|
||||||
version : '0.14.2',
|
version : '0.14.1',
|
||||||
)
|
)
|
||||||
|
|
||||||
subdir('protocols')
|
subdir('protocols')
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ static void finish_exchange_arrange_and_focus(Client *c1, Client *c2,
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_tile_resize(Client *c, struct wlr_box geo, int32_t interact) {
|
void client_tile_resize(Client *c, struct wlr_box geo, int32_t interact) {
|
||||||
if (!ISFAKETILED(c))
|
if (!ISSCROLLTILED(c))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!c->isfullscreen && !c->ismaximizescreen) {
|
if (!c->isfullscreen && !c->ismaximizescreen) {
|
||||||
|
|
|
||||||
|
|
@ -495,7 +495,6 @@ void apply_border(Client *c) {
|
||||||
|
|
||||||
if (c->isfullscreen) {
|
if (c->isfullscreen) {
|
||||||
if (c->border->node.enabled) {
|
if (c->border->node.enabled) {
|
||||||
wlr_scene_node_set_position(&c->scene_surface->node, 0, 0);
|
|
||||||
wlr_scene_node_set_enabled(&c->border->node, false);
|
wlr_scene_node_set_enabled(&c->border->node, false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -699,6 +698,17 @@ void client_set_drop_area(Client *c) {
|
||||||
bool dwindle_familiar =
|
bool dwindle_familiar =
|
||||||
cur_layout->id == DWINDLE && config.dwindle_drop_simple_split;
|
cur_layout->id == DWINDLE && config.dwindle_drop_simple_split;
|
||||||
|
|
||||||
|
uint32_t nmaster = c->mon->pertag->nmasters[c->mon->pertag->curtag];
|
||||||
|
|
||||||
|
bool should_swap =
|
||||||
|
(cur_layout->id == DECK || cur_layout->id == VERTICAL_DECK ||
|
||||||
|
cur_layout->id == MONOCLE || cur_layout->id == GRID ||
|
||||||
|
cur_layout->id == FAIR || cur_layout->id == VERTICAL_FAIR ||
|
||||||
|
cur_layout->id == VERTICAL_GRID) ||
|
||||||
|
((cur_layout->id == TILE || cur_layout->id == VERTICAL_TILE ||
|
||||||
|
cur_layout->id == CENTER_TILE || cur_layout->id == RIGHT_TILE) &&
|
||||||
|
nmaster == 1 && c->ismaster);
|
||||||
|
|
||||||
if (dwindle_familiar) {
|
if (dwindle_familiar) {
|
||||||
bool split_h = c->geom.width >= c->geom.height;
|
bool split_h = c->geom.width >= c->geom.height;
|
||||||
float ratio = config.dwindle_split_ratio;
|
float ratio = config.dwindle_split_ratio;
|
||||||
|
|
@ -732,87 +742,42 @@ void client_set_drop_area(Client *c) {
|
||||||
client_height - (int32_t)(client_height * ratio);
|
client_height - (int32_t)(client_height * ratio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (should_swap) {
|
||||||
|
drop_box.x = bw;
|
||||||
|
drop_box.y = bw;
|
||||||
|
drop_box.width = client_width;
|
||||||
|
drop_box.height = client_height;
|
||||||
|
drop_direction = UNDIR;
|
||||||
} else if (cur_layout->id == TILE || cur_layout->id == DECK ||
|
} else if (cur_layout->id == TILE || cur_layout->id == DECK ||
|
||||||
cur_layout->id == CENTER_TILE || cur_layout->id == RIGHT_TILE) {
|
cur_layout->id == CENTER_TILE || cur_layout->id == RIGHT_TILE) {
|
||||||
|
if (rel_y < client_height * 0.5) {
|
||||||
if (c->ismaster) {
|
drop_direction = UP;
|
||||||
if (c->mon->visible_tiling_clients == 1) {
|
drop_box.x = bw;
|
||||||
if (rel_x < client_width * 0.5) {
|
drop_box.y = bw;
|
||||||
drop_direction = LEFT;
|
drop_box.width = client_width;
|
||||||
drop_box.x = bw;
|
drop_box.height = client_height / 2;
|
||||||
drop_box.y = bw;
|
|
||||||
drop_box.width = client_width / 2;
|
|
||||||
drop_box.height = client_height;
|
|
||||||
} else {
|
|
||||||
drop_direction = RIGHT;
|
|
||||||
drop_box.x = bw + client_width / 2;
|
|
||||||
drop_box.y = bw;
|
|
||||||
drop_box.width = client_width / 2;
|
|
||||||
drop_box.height = client_height;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
drop_box.x = bw;
|
|
||||||
drop_box.y = bw;
|
|
||||||
drop_box.width = client_width;
|
|
||||||
drop_box.height = client_height;
|
|
||||||
drop_direction = UNDIR;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (rel_y < client_height * 0.5) {
|
drop_direction = DOWN;
|
||||||
drop_direction = UP;
|
drop_box.x = bw;
|
||||||
drop_box.x = bw;
|
drop_box.y = bw + client_height / 2;
|
||||||
drop_box.y = bw;
|
drop_box.width = client_width;
|
||||||
drop_box.width = client_width;
|
drop_box.height = client_height / 2;
|
||||||
drop_box.height = client_height / 2;
|
|
||||||
} else {
|
|
||||||
drop_direction = DOWN;
|
|
||||||
drop_box.x = bw;
|
|
||||||
drop_box.y = bw + client_height / 2;
|
|
||||||
drop_box.width = client_width;
|
|
||||||
drop_box.height = client_height / 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (cur_layout->id == VERTICAL_TILE ||
|
} else if (cur_layout->id == VERTICAL_TILE ||
|
||||||
cur_layout->id == VERTICAL_DECK) {
|
cur_layout->id == VERTICAL_DECK) {
|
||||||
if (c->ismaster) {
|
if (rel_x < client_width * 0.5) {
|
||||||
if (c->mon->visible_tiling_clients == 1) {
|
drop_direction = LEFT;
|
||||||
if (rel_y < client_height * 0.5) {
|
drop_box.x = bw;
|
||||||
drop_direction = UP;
|
drop_box.y = bw;
|
||||||
drop_box.x = bw;
|
drop_box.width = client_width / 2;
|
||||||
drop_box.y = bw;
|
drop_box.height = client_height;
|
||||||
drop_box.width = client_width;
|
|
||||||
drop_box.height = client_height / 2;
|
|
||||||
} else {
|
|
||||||
drop_direction = DOWN;
|
|
||||||
drop_box.x = bw;
|
|
||||||
drop_box.y = bw + client_height / 2;
|
|
||||||
drop_box.width = client_width;
|
|
||||||
drop_box.height = client_height / 2;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
drop_box.x = bw;
|
|
||||||
drop_box.y = bw;
|
|
||||||
drop_box.width = client_width;
|
|
||||||
drop_box.height = client_height;
|
|
||||||
drop_direction = UNDIR;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (rel_x < client_width * 0.5) {
|
drop_direction = RIGHT;
|
||||||
drop_direction = LEFT;
|
drop_box.x = bw + client_width / 2;
|
||||||
drop_box.x = bw;
|
drop_box.y = bw;
|
||||||
drop_box.y = bw;
|
drop_box.width = client_width / 2;
|
||||||
drop_box.width = client_width / 2;
|
drop_box.height = client_height;
|
||||||
drop_box.height = client_height;
|
|
||||||
} else {
|
|
||||||
drop_direction = RIGHT;
|
|
||||||
drop_box.x = bw + client_width / 2;
|
|
||||||
drop_box.y = bw;
|
|
||||||
drop_box.width = client_width / 2;
|
|
||||||
drop_box.height = client_height;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
double dist_left = rel_x;
|
double dist_left = rel_x;
|
||||||
double dist_right = client_width - rel_x;
|
double dist_right = client_width - rel_x;
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,6 @@ typedef struct {
|
||||||
int32_t overviewgappi;
|
int32_t overviewgappi;
|
||||||
int32_t overviewgappo;
|
int32_t overviewgappo;
|
||||||
uint32_t cursor_hide_timeout;
|
uint32_t cursor_hide_timeout;
|
||||||
uint32_t cursor_hide_on_keypress;
|
|
||||||
|
|
||||||
uint32_t axis_bind_apply_timeout;
|
uint32_t axis_bind_apply_timeout;
|
||||||
uint32_t focus_on_activate;
|
uint32_t focus_on_activate;
|
||||||
|
|
@ -1715,8 +1714,6 @@ bool parse_option(Config *config, char *key, char *value) {
|
||||||
config->overviewgappo = atoi(value);
|
config->overviewgappo = atoi(value);
|
||||||
} else if (strcmp(key, "cursor_hide_timeout") == 0) {
|
} else if (strcmp(key, "cursor_hide_timeout") == 0) {
|
||||||
config->cursor_hide_timeout = atoi(value);
|
config->cursor_hide_timeout = atoi(value);
|
||||||
} else if (strcmp(key, "cursor_hide_on_keypress") == 0) {
|
|
||||||
config->cursor_hide_on_keypress = atoi(value);
|
|
||||||
} else if (strcmp(key, "axis_bind_apply_timeout") == 0) {
|
} else if (strcmp(key, "axis_bind_apply_timeout") == 0) {
|
||||||
config->axis_bind_apply_timeout = atoi(value);
|
config->axis_bind_apply_timeout = atoi(value);
|
||||||
} else if (strcmp(key, "focus_on_activate") == 0) {
|
} else if (strcmp(key, "focus_on_activate") == 0) {
|
||||||
|
|
@ -3349,8 +3346,6 @@ void override_config(void) {
|
||||||
CLAMP_INT(config.no_radius_when_single, 0, 1);
|
CLAMP_INT(config.no_radius_when_single, 0, 1);
|
||||||
config.cursor_hide_timeout =
|
config.cursor_hide_timeout =
|
||||||
CLAMP_INT(config.cursor_hide_timeout, 0, 36000);
|
CLAMP_INT(config.cursor_hide_timeout, 0, 36000);
|
||||||
config.cursor_hide_on_keypress =
|
|
||||||
CLAMP_INT(config.cursor_hide_on_keypress, 0, 1);
|
|
||||||
config.single_scratchpad = CLAMP_INT(config.single_scratchpad, 0, 1);
|
config.single_scratchpad = CLAMP_INT(config.single_scratchpad, 0, 1);
|
||||||
config.repeat_rate = CLAMP_INT(config.repeat_rate, 1, 1000);
|
config.repeat_rate = CLAMP_INT(config.repeat_rate, 1, 1000);
|
||||||
config.repeat_delay = CLAMP_INT(config.repeat_delay, 1, 20000);
|
config.repeat_delay = CLAMP_INT(config.repeat_delay, 1, 20000);
|
||||||
|
|
@ -3512,7 +3507,6 @@ void set_value_default() {
|
||||||
config.overviewgappi = 5;
|
config.overviewgappi = 5;
|
||||||
config.overviewgappo = 30;
|
config.overviewgappo = 30;
|
||||||
config.cursor_hide_timeout = 0;
|
config.cursor_hide_timeout = 0;
|
||||||
config.cursor_hide_on_keypress = 0;
|
|
||||||
|
|
||||||
config.warpcursor = 1;
|
config.warpcursor = 1;
|
||||||
config.drag_corner = 3;
|
config.drag_corner = 3;
|
||||||
|
|
|
||||||
|
|
@ -91,9 +91,9 @@ setclient_coordinate_center(Client *c, Monitor *tm, struct wlr_box geom,
|
||||||
if (!m)
|
if (!m)
|
||||||
return geom;
|
return geom;
|
||||||
|
|
||||||
uint32_t cbw = c && check_hit_no_border(c) ? c->bw : 0;
|
uint32_t cbw = check_hit_no_border(c) ? c->bw : 0;
|
||||||
|
|
||||||
if ((!c || !c->no_force_center) && m) {
|
if (!c->no_force_center && m) {
|
||||||
tempbox.x = m->w.x + (m->w.width - geom.width) / 2;
|
tempbox.x = m->w.x + (m->w.width - geom.width) / 2;
|
||||||
tempbox.y = m->w.y + (m->w.height - geom.height) / 2;
|
tempbox.y = m->w.y + (m->w.height - geom.height) / 2;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -160,26 +160,11 @@ void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
|
||||||
if (pl)
|
if (pl)
|
||||||
*pl = l;
|
*pl = l;
|
||||||
|
|
||||||
if (selmon && selmon->isoverview && config.ov_no_resize) {
|
if (selmon && selmon->isoverview && (!l || layer_ignores_focus(l))) {
|
||||||
ovc = xytoclient(x, y);
|
ovc = xytoclient(x, y);
|
||||||
|
if (pc)
|
||||||
bool is_below = false;
|
*pc = ovc;
|
||||||
if (l && l->layer_surface) {
|
if (psurface && ovc)
|
||||||
is_below = (l->layer_surface->current.layer ==
|
*psurface = client_surface(ovc);
|
||||||
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND ||
|
|
||||||
l->layer_surface->current.layer ==
|
|
||||||
ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ovc && (!l || layer_ignores_focus(l) || is_below)) {
|
|
||||||
if (pc)
|
|
||||||
*pc = ovc;
|
|
||||||
|
|
||||||
if (psurface)
|
|
||||||
*psurface = ovc ? client_surface(ovc) : NULL;
|
|
||||||
|
|
||||||
if (pl && ovc)
|
|
||||||
*pl = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -751,7 +751,6 @@ void resize_tile_grid_fair(Client *grabc, bool isdrag, int32_t offsetx,
|
||||||
|
|
||||||
void resize_tile_scroller(Client *grabc, bool isdrag, int32_t offsetx,
|
void resize_tile_scroller(Client *grabc, bool isdrag, int32_t offsetx,
|
||||||
int32_t offsety, uint32_t time, bool isvertical) {
|
int32_t offsety, uint32_t time, bool isvertical) {
|
||||||
|
|
||||||
if (!grabc || grabc->isfullscreen || grabc->ismaximizescreen)
|
if (!grabc || grabc->isfullscreen || grabc->ismaximizescreen)
|
||||||
return;
|
return;
|
||||||
if (grabc->mon->isoverview)
|
if (grabc->mon->isoverview)
|
||||||
|
|
@ -773,7 +772,7 @@ void resize_tile_scroller(Client *grabc, bool isdrag, int32_t offsetx,
|
||||||
|
|
||||||
Client *stack_head_client = headnode->client;
|
Client *stack_head_client = headnode->client;
|
||||||
|
|
||||||
if (m->visible_scroll_tiling_clients == 1 &&
|
if (m->visible_tiling_clients == 1 &&
|
||||||
!config.scroller_ignore_proportion_single)
|
!config.scroller_ignore_proportion_single)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -500,13 +500,16 @@ void deck(Monitor *m) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wl_list_for_each(fc, &clients, link) {
|
wl_list_for_each(fc, &clients, link) {
|
||||||
|
|
||||||
if (VISIBLEON(fc, m) && ISFAKETILED(fc))
|
if (VISIBLEON(fc, m) && ISFAKETILED(fc))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate master width using mfact from pertag
|
||||||
mfact = fc->master_mfact_per > 0.0f ? fc->master_mfact_per
|
mfact = fc->master_mfact_per > 0.0f ? fc->master_mfact_per
|
||||||
: m->pertag->mfacts[m->pertag->curtag];
|
: m->pertag->mfacts[m->pertag->curtag];
|
||||||
|
|
||||||
|
// Calculate master width including outer gaps
|
||||||
if (n > nmasters)
|
if (n > nmasters)
|
||||||
mw = nmasters ? round((m->w.width - 2 * cur_gappoh) * mfact) : 0;
|
mw = nmasters ? round((m->w.width - 2 * cur_gappoh) * mfact) : 0;
|
||||||
else
|
else
|
||||||
|
|
@ -518,15 +521,16 @@ void deck(Monitor *m) {
|
||||||
continue;
|
continue;
|
||||||
if (i < nmasters) {
|
if (i < nmasters) {
|
||||||
c->master_mfact_per = mfact;
|
c->master_mfact_per = mfact;
|
||||||
int32_t h =
|
// Master area clients
|
||||||
(m->w.height - 2 * cur_gappov - my) / (MIN(n, nmasters) - i);
|
client_tile_resize(
|
||||||
client_tile_resize(c,
|
c,
|
||||||
(struct wlr_box){.x = m->w.x + cur_gappoh,
|
(struct wlr_box){.x = m->w.x + cur_gappoh,
|
||||||
.y = m->w.y + cur_gappov + my,
|
.y = m->w.y + cur_gappov + my,
|
||||||
.width = mw,
|
.width = mw,
|
||||||
.height = h},
|
.height = (m->w.height - 2 * cur_gappov - my) /
|
||||||
0);
|
(MIN(n, nmasters) - i)},
|
||||||
my += h;
|
0);
|
||||||
|
my += c->geom.height;
|
||||||
} else {
|
} else {
|
||||||
// Stack area clients
|
// Stack area clients
|
||||||
c->master_mfact_per = mfact;
|
c->master_mfact_per = mfact;
|
||||||
|
|
@ -584,7 +588,6 @@ void grid(Monitor *m) {
|
||||||
int32_t target_gappi = enablegaps ? config.gappih : 0;
|
int32_t target_gappi = enablegaps ? config.gappih : 0;
|
||||||
float single_width_ratio = 0.9;
|
float single_width_ratio = 0.9;
|
||||||
float single_height_ratio = 0.9;
|
float single_height_ratio = 0.9;
|
||||||
struct wlr_box target_geom;
|
|
||||||
|
|
||||||
n = m->visible_fake_tiling_clients;
|
n = m->visible_fake_tiling_clients;
|
||||||
|
|
||||||
|
|
@ -600,11 +603,11 @@ void grid(Monitor *m) {
|
||||||
ISFAKETILED(c))) {
|
ISFAKETILED(c))) {
|
||||||
cw = (m->w.width - 2 * target_gappo) * single_width_ratio;
|
cw = (m->w.width - 2 * target_gappo) * single_width_ratio;
|
||||||
ch = (m->w.height - 2 * target_gappo) * single_height_ratio;
|
ch = (m->w.height - 2 * target_gappo) * single_height_ratio;
|
||||||
target_geom.x = m->w.x + (m->w.width - cw) / 2;
|
c->geom.x = m->w.x + (m->w.width - cw) / 2;
|
||||||
target_geom.y = m->w.y + (m->w.height - ch) / 2;
|
c->geom.y = m->w.y + (m->w.height - ch) / 2;
|
||||||
target_geom.width = cw;
|
c->geom.width = cw;
|
||||||
target_geom.height = ch;
|
c->geom.height = ch;
|
||||||
client_tile_resize(c, target_geom, 0);
|
client_tile_resize(c, c->geom, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -648,16 +651,16 @@ void grid(Monitor *m) {
|
||||||
cw = avail_w * (col_pers[i] / sum_col);
|
cw = avail_w * (col_pers[i] / sum_col);
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
target_geom.x = m->w.x + target_gappo;
|
c->geom.x = m->w.x + target_gappo;
|
||||||
} else if (i == 1) {
|
} else if (i == 1) {
|
||||||
// 第二个窗口的 X 坐标紧跟第一个窗口后面
|
// 第二个窗口的 X 坐标紧跟第一个窗口后面
|
||||||
float cw0 = avail_w * (col_pers[0] / sum_col);
|
float cw0 = avail_w * (col_pers[0] / sum_col);
|
||||||
target_geom.x = m->w.x + target_gappo + cw0 + target_gappi;
|
c->geom.x = m->w.x + target_gappo + cw0 + target_gappi;
|
||||||
}
|
}
|
||||||
target_geom.y = m->w.y + (m->w.height - ch) / 2 + target_gappo;
|
c->geom.y = m->w.y + (m->w.height - ch) / 2 + target_gappo;
|
||||||
target_geom.width = cw;
|
c->geom.width = cw;
|
||||||
target_geom.height = ch;
|
c->geom.height = ch;
|
||||||
client_tile_resize(c, target_geom, 0);
|
client_tile_resize(c, c->geom, 0);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -754,11 +757,11 @@ void grid(Monitor *m) {
|
||||||
? (m->w.y + m->w.height - target_gappo - fl_cy)
|
? (m->w.y + m->w.height - target_gappo - fl_cy)
|
||||||
: avail_h * (row_pers[r_idx] / sum_row);
|
: avail_h * (row_pers[r_idx] / sum_row);
|
||||||
|
|
||||||
target_geom.x = (int32_t)fl_cx;
|
c->geom.x = (int32_t)fl_cx;
|
||||||
target_geom.y = (int32_t)fl_cy;
|
c->geom.y = (int32_t)fl_cy;
|
||||||
target_geom.width = (int32_t)fl_cw;
|
c->geom.width = (int32_t)fl_cw;
|
||||||
target_geom.height = (int32_t)fl_ch;
|
c->geom.height = (int32_t)fl_ch;
|
||||||
client_tile_resize(c, target_geom, 0);
|
client_tile_resize(c, c->geom, 0);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,10 +137,12 @@ void vertical_deck(Monitor *m) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wl_list_for_each(fc, &clients, link) {
|
wl_list_for_each(fc, &clients, link) {
|
||||||
|
|
||||||
if (VISIBLEON(fc, m) && ISFAKETILED(fc))
|
if (VISIBLEON(fc, m) && ISFAKETILED(fc))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate master width using mfact from pertag
|
||||||
mfact = fc->master_mfact_per > 0.0f ? fc->master_mfact_per
|
mfact = fc->master_mfact_per > 0.0f ? fc->master_mfact_per
|
||||||
: m->pertag->mfacts[m->pertag->curtag];
|
: m->pertag->mfacts[m->pertag->curtag];
|
||||||
|
|
||||||
|
|
@ -154,18 +156,16 @@ void vertical_deck(Monitor *m) {
|
||||||
if (!VISIBLEON(c, m) || !ISFAKETILED(c))
|
if (!VISIBLEON(c, m) || !ISFAKETILED(c))
|
||||||
continue;
|
continue;
|
||||||
if (i < nmasters) {
|
if (i < nmasters) {
|
||||||
c->master_mfact_per = mfact;
|
client_tile_resize(
|
||||||
int32_t w =
|
c,
|
||||||
(m->w.width - 2 * cur_gappoh - mx) / (MIN(n, nmasters) - i);
|
(struct wlr_box){.x = m->w.x + cur_gappoh + mx,
|
||||||
client_tile_resize(c,
|
.y = m->w.y + cur_gappov,
|
||||||
(struct wlr_box){.x = m->w.x + cur_gappoh + mx,
|
.width = (m->w.width - 2 * cur_gappoh - mx) /
|
||||||
.y = m->w.y + cur_gappov,
|
(MIN(n, nmasters) - i),
|
||||||
.width = w,
|
.height = mh},
|
||||||
.height = mh},
|
0);
|
||||||
0);
|
mx += c->geom.width;
|
||||||
mx += w;
|
|
||||||
} else {
|
} else {
|
||||||
c->master_mfact_per = mfact;
|
|
||||||
client_tile_resize(
|
client_tile_resize(
|
||||||
c,
|
c,
|
||||||
(struct wlr_box){.x = m->w.x + cur_gappoh,
|
(struct wlr_box){.x = m->w.x + cur_gappoh,
|
||||||
|
|
@ -186,13 +186,14 @@ void vertical_grid(Monitor *m) {
|
||||||
int32_t cw, ch;
|
int32_t cw, ch;
|
||||||
int32_t rows, cols, overrows;
|
int32_t rows, cols, overrows;
|
||||||
Client *c = NULL;
|
Client *c = NULL;
|
||||||
int32_t target_gappo = enablegaps ? config.gappov : 0;
|
int32_t target_gappo =
|
||||||
int32_t target_gappi = enablegaps ? config.gappiv : 0;
|
enablegaps ? m->isoverview ? config.overviewgappo : config.gappov : 0;
|
||||||
float single_width_ratio = 0.9;
|
int32_t target_gappi =
|
||||||
float single_height_ratio = 0.9;
|
enablegaps ? m->isoverview ? config.overviewgappi : config.gappiv : 0;
|
||||||
struct wlr_box target_geom;
|
float single_width_ratio = m->isoverview ? 0.7 : 0.9;
|
||||||
|
float single_height_ratio = m->isoverview ? 0.8 : 0.9;
|
||||||
|
|
||||||
n = m->visible_fake_tiling_clients;
|
n = m->isoverview ? m->visible_clients : m->visible_fake_tiling_clients;
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -201,14 +202,15 @@ void vertical_grid(Monitor *m) {
|
||||||
if (c->mon != m)
|
if (c->mon != m)
|
||||||
continue;
|
continue;
|
||||||
if (VISIBLEON(c, m) && !c->isunglobal &&
|
if (VISIBLEON(c, m) && !c->isunglobal &&
|
||||||
(!client_is_x11_popup(c) || ISFAKETILED(c))) {
|
((m->isoverview && !client_is_x11_popup(c)) ||
|
||||||
|
ISFAKETILED(c))) {
|
||||||
ch = (m->w.height - 2 * target_gappo) * single_height_ratio;
|
ch = (m->w.height - 2 * target_gappo) * single_height_ratio;
|
||||||
cw = (m->w.width - 2 * target_gappo) * single_width_ratio;
|
cw = (m->w.width - 2 * target_gappo) * single_width_ratio;
|
||||||
target_geom.x = m->w.x + (m->w.width - cw) / 2;
|
c->geom.x = m->w.x + (m->w.width - cw) / 2;
|
||||||
target_geom.y = m->w.y + (m->w.height - ch) / 2;
|
c->geom.y = m->w.y + (m->w.height - ch) / 2;
|
||||||
target_geom.width = cw;
|
c->geom.width = cw;
|
||||||
target_geom.height = ch;
|
c->geom.height = ch;
|
||||||
client_tile_resize(c, target_geom, 0);
|
client_tile_resize(c, c->geom, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -222,7 +224,8 @@ void vertical_grid(Monitor *m) {
|
||||||
if (c->mon != m)
|
if (c->mon != m)
|
||||||
continue;
|
continue;
|
||||||
if (VISIBLEON(c, m) && !c->isunglobal &&
|
if (VISIBLEON(c, m) && !c->isunglobal &&
|
||||||
(!client_is_x11_popup(c) || ISFAKETILED(c))) {
|
((m->isoverview && !client_is_x11_popup(c)) ||
|
||||||
|
ISFAKETILED(c))) {
|
||||||
if (i < 2)
|
if (i < 2)
|
||||||
row_pers[i] =
|
row_pers[i] =
|
||||||
(c->grid_row_per > 0.0f) ? c->grid_row_per : 1.0f;
|
(c->grid_row_per > 0.0f) ? c->grid_row_per : 1.0f;
|
||||||
|
|
@ -239,7 +242,8 @@ void vertical_grid(Monitor *m) {
|
||||||
if (c->mon != m)
|
if (c->mon != m)
|
||||||
continue;
|
continue;
|
||||||
if (VISIBLEON(c, m) && !c->isunglobal &&
|
if (VISIBLEON(c, m) && !c->isunglobal &&
|
||||||
(!client_is_x11_popup(c) || ISFAKETILED(c))) {
|
((m->isoverview && !client_is_x11_popup(c)) ||
|
||||||
|
ISFAKETILED(c))) {
|
||||||
c->grid_col_idx = 0;
|
c->grid_col_idx = 0;
|
||||||
c->grid_row_idx = i;
|
c->grid_row_idx = i;
|
||||||
c->grid_col_per = 1.0f;
|
c->grid_col_per = 1.0f;
|
||||||
|
|
@ -248,17 +252,17 @@ void vertical_grid(Monitor *m) {
|
||||||
// 根据分配的权重动态计算当前窗口的高度
|
// 根据分配的权重动态计算当前窗口的高度
|
||||||
ch = avail_h * (row_pers[i] / sum_row);
|
ch = avail_h * (row_pers[i] / sum_row);
|
||||||
|
|
||||||
target_geom.x = m->w.x + (m->w.width - cw) / 2 + target_gappo;
|
c->geom.x = m->w.x + (m->w.width - cw) / 2 + target_gappo;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
target_geom.y = m->w.y + target_gappo;
|
c->geom.y = m->w.y + target_gappo;
|
||||||
} else if (i == 1) {
|
} else if (i == 1) {
|
||||||
// 第二个窗口的 Y 坐标紧跟第一个窗口下面
|
// 第二个窗口的 Y 坐标紧跟第一个窗口下面
|
||||||
float ch0 = avail_h * (row_pers[0] / sum_row);
|
float ch0 = avail_h * (row_pers[0] / sum_row);
|
||||||
target_geom.y = m->w.y + target_gappo + ch0 + target_gappi;
|
c->geom.y = m->w.y + target_gappo + ch0 + target_gappi;
|
||||||
}
|
}
|
||||||
target_geom.width = cw;
|
c->geom.width = cw;
|
||||||
target_geom.height = ch;
|
c->geom.height = ch;
|
||||||
client_tile_resize(c, target_geom, 0);
|
client_tile_resize(c, c->geom, 0);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -283,7 +287,7 @@ void vertical_grid(Monitor *m) {
|
||||||
if (c->mon != m)
|
if (c->mon != m)
|
||||||
continue;
|
continue;
|
||||||
if (VISIBLEON(c, m) && !c->isunglobal &&
|
if (VISIBLEON(c, m) && !c->isunglobal &&
|
||||||
(!client_is_x11_popup(c) || ISFAKETILED(c))) {
|
((m->isoverview && !client_is_x11_popup(c)) || ISFAKETILED(c))) {
|
||||||
int32_t c_idx = i / rows;
|
int32_t c_idx = i / rows;
|
||||||
int32_t r_idx = i % rows;
|
int32_t r_idx = i % rows;
|
||||||
if (r_idx == 0)
|
if (r_idx == 0)
|
||||||
|
|
@ -310,7 +314,7 @@ void vertical_grid(Monitor *m) {
|
||||||
if (c->mon != m)
|
if (c->mon != m)
|
||||||
continue;
|
continue;
|
||||||
if (VISIBLEON(c, m) && !c->isunglobal &&
|
if (VISIBLEON(c, m) && !c->isunglobal &&
|
||||||
(!client_is_x11_popup(c) || ISFAKETILED(c))) {
|
((m->isoverview && !client_is_x11_popup(c)) || ISFAKETILED(c))) {
|
||||||
int32_t c_idx = i / rows;
|
int32_t c_idx = i / rows;
|
||||||
int32_t r_idx = i % rows;
|
int32_t r_idx = i % rows;
|
||||||
|
|
||||||
|
|
@ -348,11 +352,11 @@ void vertical_grid(Monitor *m) {
|
||||||
? (m->w.x + m->w.width - target_gappo - fl_cx)
|
? (m->w.x + m->w.width - target_gappo - fl_cx)
|
||||||
: avail_w * (col_pers[c_idx] / sum_col);
|
: avail_w * (col_pers[c_idx] / sum_col);
|
||||||
|
|
||||||
target_geom.x = (int32_t)fl_cx;
|
c->geom.x = (int32_t)fl_cx;
|
||||||
target_geom.y = (int32_t)fl_cy;
|
c->geom.y = (int32_t)fl_cy;
|
||||||
target_geom.width = (int32_t)fl_cw;
|
c->geom.width = (int32_t)fl_cw;
|
||||||
target_geom.height = (int32_t)fl_ch;
|
c->geom.height = (int32_t)fl_ch;
|
||||||
client_tile_resize(c, target_geom, 0);
|
client_tile_resize(c, c->geom, 0);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
113
src/mango.c
113
src/mango.c
|
|
@ -1073,7 +1073,7 @@ static struct wl_listener last_cursor_surface_destroy_listener = {
|
||||||
.notify = last_cursor_surface_destroy};
|
.notify = last_cursor_surface_destroy};
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
static void fix_xwayland_coordinate(struct wlr_box *geom);
|
static void fix_xwayland_unmanaged_coordinate(Client *c);
|
||||||
static int32_t synckeymap(void *data);
|
static int32_t synckeymap(void *data);
|
||||||
static void activatex11(struct wl_listener *listener, void *data);
|
static void activatex11(struct wl_listener *listener, void *data);
|
||||||
static void configurex11(struct wl_listener *listener, void *data);
|
static void configurex11(struct wl_listener *listener, void *data);
|
||||||
|
|
@ -1615,7 +1615,7 @@ void applyrules(Client *c) {
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (c->isfloating && client_is_x11(c)) {
|
if (c->isfloating && client_is_x11(c)) {
|
||||||
fix_xwayland_coordinate(&c->geom);
|
fix_xwayland_unmanaged_coordinate(c);
|
||||||
c->float_geom = c->geom;
|
c->float_geom = c->geom;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -2202,10 +2202,9 @@ void hold_end(struct wl_listener *listener, void *data) {
|
||||||
Client *find_closest_tiled_client(Client *c) {
|
Client *find_closest_tiled_client(Client *c) {
|
||||||
Client *tc, *closest = NULL;
|
Client *tc, *closest = NULL;
|
||||||
long min_dist = LONG_MAX;
|
long min_dist = LONG_MAX;
|
||||||
Monitor *cursor_mon = xytomon(cursor->x, cursor->y);
|
|
||||||
|
|
||||||
wl_list_for_each(tc, &clients, link) {
|
wl_list_for_each(tc, &clients, link) {
|
||||||
if (tc == c || !ISTILED(tc) || !VISIBLEON(tc, cursor_mon))
|
if (tc == c || !ISTILED(tc) || !VISIBLEON(tc, c->mon))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (cursor->x >= tc->geom.x &&
|
if (cursor->x >= tc->geom.x &&
|
||||||
|
|
@ -2237,9 +2236,7 @@ void place_drag_tile_client(Client *c) {
|
||||||
|
|
||||||
if (closest->drop_direction == UNDIR) {
|
if (closest->drop_direction == UNDIR) {
|
||||||
setfloating(c, 0);
|
setfloating(c, 0);
|
||||||
wl_list_remove(&c->link);
|
exchange_two_client(c, closest);
|
||||||
wl_list_insert(closest->link.prev, &c->link);
|
|
||||||
arrange(closest->mon, false, false);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2338,17 +2335,6 @@ bool handle_buttonpress(struct wlr_pointer_button_event *event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// overview模式下鼠标左键跳转,右键关闭窗口
|
|
||||||
if (selmon && selmon->isoverview && event->button == BTN_LEFT && c) {
|
|
||||||
toggleoverview(&(Arg){.i = 1});
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selmon && selmon->isoverview && event->button == BTN_RIGHT && c) {
|
|
||||||
pending_kill_client(c);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 当鼠标焦点在layer上的时候,不检测虚拟键盘的mod状态,
|
// 当鼠标焦点在layer上的时候,不检测虚拟键盘的mod状态,
|
||||||
// 避免layer虚拟键盘锁死mod按键状态
|
// 避免layer虚拟键盘锁死mod按键状态
|
||||||
hard_keyboard = &kb_group->wlr_group->keyboard;
|
hard_keyboard = &kb_group->wlr_group->keyboard;
|
||||||
|
|
@ -2365,6 +2351,16 @@ bool handle_buttonpress(struct wlr_pointer_button_event *event) {
|
||||||
break;
|
break;
|
||||||
m = &config.mouse_bindings[ji];
|
m = &config.mouse_bindings[ji];
|
||||||
|
|
||||||
|
if (selmon->isoverview && event->button == BTN_LEFT && c) {
|
||||||
|
toggleoverview(&(Arg){.i = 1});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selmon->isoverview && event->button == BTN_RIGHT && c) {
|
||||||
|
pending_kill_client(c);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (CLEANMASK(mods) == CLEANMASK(m->mod) &&
|
if (CLEANMASK(mods) == CLEANMASK(m->mod) &&
|
||||||
event->button == m->button && m->func &&
|
event->button == m->button && m->func &&
|
||||||
(CLEANMASK(m->mod) != 0 ||
|
(CLEANMASK(m->mod) != 0 ||
|
||||||
|
|
@ -3144,6 +3140,7 @@ void createlayersurface(struct wl_listener *listener, void *data) {
|
||||||
LISTEN(&l->scene->node.events.destroy, &l->destroy, destroylayernodenotify);
|
LISTEN(&l->scene->node.events.destroy, &l->destroy, destroylayernodenotify);
|
||||||
|
|
||||||
wl_list_insert(&l->mon->layers[layer_surface->pending.layer], &l->link);
|
wl_list_insert(&l->mon->layers[layer_surface->pending.layer], &l->link);
|
||||||
|
wlr_surface_send_enter(surface, layer_surface->output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void createlocksurface(struct wl_listener *listener, void *data) {
|
void createlocksurface(struct wl_listener *listener, void *data) {
|
||||||
|
|
@ -4209,11 +4206,6 @@ void keypress(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.cursor_hide_on_keypress && !cursor_hidden &&
|
|
||||||
event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
|
||||||
hidecursor(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* On _press_ if there is no active screen locker,
|
/* On _press_ if there is no active screen locker,
|
||||||
* attempt to process a compositor keybinding. */
|
* attempt to process a compositor keybinding. */
|
||||||
for (i = 0; i < nsyms; i++)
|
for (i = 0; i < nsyms; i++)
|
||||||
|
|
@ -4477,24 +4469,24 @@ mapnotify(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
/* Handle unmanaged clients first so we can return prior create borders
|
/* Handle unmanaged clients first so we can return prior create borders
|
||||||
*/
|
*/
|
||||||
#ifdef XWAYLAND
|
|
||||||
if (client_is_unmanaged(c)) {
|
if (client_is_unmanaged(c)) {
|
||||||
/* Unmanaged clients always are floating */
|
/* Unmanaged clients always are floating */
|
||||||
fix_xwayland_coordinate(&c->geom);
|
#ifdef XWAYLAND
|
||||||
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
|
if (client_is_x11(c)) {
|
||||||
wlr_xwayland_surface_configure(c->surface.xwayland, c->geom.x,
|
fix_xwayland_unmanaged_coordinate(c);
|
||||||
c->geom.y, c->geom.width,
|
LISTEN(&c->surface.xwayland->events.set_geometry, &c->set_geometry,
|
||||||
c->geom.height);
|
setgeometrynotify);
|
||||||
LISTEN(&c->surface.xwayland->events.set_geometry, &c->set_geometry,
|
}
|
||||||
setgeometrynotify);
|
#endif
|
||||||
wlr_scene_node_reparent(&c->scene->node, layers[LyrOverlay]);
|
wlr_scene_node_reparent(&c->scene->node, layers[LyrOverlay]);
|
||||||
|
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
|
||||||
if (client_wants_focus(c)) {
|
if (client_wants_focus(c)) {
|
||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
exclusive_focus = c;
|
exclusive_focus = c;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// extra node
|
// extra node
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
|
|
@ -4816,8 +4808,7 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
|
||||||
if (!surface && !seat->drag && !cursor_hidden)
|
if (!surface && !seat->drag && !cursor_hidden)
|
||||||
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
|
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
|
||||||
|
|
||||||
if (c && c->mon && !c->animation.running &&
|
if (c && c->mon && !c->animation.running && (INSIDEMON(c) || !ISTILED(c))) {
|
||||||
(INSIDEMON(c) || !ISSCROLLTILED(c))) {
|
|
||||||
scroller_focus_lock = 0;
|
scroller_focus_lock = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4829,15 +4820,13 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!scroller_focus_lock || !(c && c->mon && !INSIDEMON(c))) {
|
if (!scroller_focus_lock || !(c && c->mon && !INSIDEMON(c))) {
|
||||||
if (c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) &&
|
if (c && c->mon && is_scroller_layout(c->mon) && !INSIDEMON(c)) {
|
||||||
!INSIDEMON(c)) {
|
|
||||||
should_lock = true;
|
should_lock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((!config.edge_scroller_pointer_focus ||
|
if (!((!config.edge_scroller_pointer_focus ||
|
||||||
speed < config.edge_scroller_focus_allow_speed) &&
|
speed < config.edge_scroller_focus_allow_speed) &&
|
||||||
c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) &&
|
c && c->mon && is_scroller_layout(c->mon) && !INSIDEMON(c))) {
|
||||||
!INSIDEMON(c))) {
|
|
||||||
pointerfocus(c, surface, sx, sy, time);
|
pointerfocus(c, surface, sx, sy, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6836,17 +6825,16 @@ void virtualpointer(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
void fix_xwayland_coordinate(struct wlr_box *geom) {
|
void fix_xwayland_unmanaged_coordinate(Client *c) {
|
||||||
if (!selmon)
|
if (!selmon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// 1. 如果窗口已经在当前活动显示器内,直接返回
|
// 1. 如果窗口已经在当前活动显示器内,直接返回
|
||||||
if (geom->x >= selmon->m.x && geom->x <= selmon->m.x + selmon->m.width &&
|
if (c->geom.x >= selmon->m.x && c->geom.x < selmon->m.x + selmon->m.width &&
|
||||||
geom->y >= selmon->m.y && geom->y <= selmon->m.y + selmon->m.height)
|
c->geom.y >= selmon->m.y && c->geom.y < selmon->m.y + selmon->m.height)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
geom->x = selmon->m.x + (selmon->m.width - geom->width) / 2;
|
c->geom = setclient_coordinate_center(c, selmon, c->geom, 0, 0);
|
||||||
geom->y = selmon->m.y + (selmon->m.height - geom->height) / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t synckeymap(void *data) {
|
int32_t synckeymap(void *data) {
|
||||||
|
|
@ -6901,41 +6889,24 @@ void activatex11(struct wl_listener *listener, void *data) {
|
||||||
void configurex11(struct wl_listener *listener, void *data) {
|
void configurex11(struct wl_listener *listener, void *data) {
|
||||||
Client *c = wl_container_of(listener, c, configure);
|
Client *c = wl_container_of(listener, c, configure);
|
||||||
struct wlr_xwayland_surface_configure_event *event = data;
|
struct wlr_xwayland_surface_configure_event *event = data;
|
||||||
struct wlr_box new_geo;
|
|
||||||
new_geo.x = event->x;
|
|
||||||
new_geo.y = event->y;
|
|
||||||
new_geo.width = event->width;
|
|
||||||
new_geo.height = event->height;
|
|
||||||
fix_xwayland_coordinate(&new_geo);
|
|
||||||
|
|
||||||
if (!client_surface(c) || !client_surface(c)->mapped) {
|
if (!client_surface(c) || !client_surface(c)->mapped) {
|
||||||
|
wlr_xwayland_surface_configure(c->surface.xwayland, event->x, event->y,
|
||||||
wlr_xwayland_surface_configure(c->surface.xwayland, new_geo.x,
|
event->width, event->height);
|
||||||
new_geo.y, new_geo.width,
|
|
||||||
new_geo.height);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client_is_unmanaged(c)) {
|
if (client_is_unmanaged(c)) {
|
||||||
wlr_scene_node_set_position(&c->scene->node, new_geo.x, new_geo.y);
|
wlr_scene_node_set_position(&c->scene->node, event->x, event->y);
|
||||||
wlr_xwayland_surface_configure(c->surface.xwayland, new_geo.x,
|
wlr_xwayland_surface_configure(c->surface.xwayland, event->x, event->y,
|
||||||
new_geo.y, new_geo.width,
|
event->width, event->height);
|
||||||
new_geo.height);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ((c->isfloating && c != grabc) ||
|
||||||
if (c->isfloating && c != grabc) {
|
!c->mon->pertag->ltidxs[c->mon->pertag->curtag]->arrange) {
|
||||||
new_geo.x = new_geo.x - c->bw;
|
|
||||||
new_geo.y = new_geo.y - c->bw;
|
|
||||||
new_geo.width = new_geo.width + c->bw * 2;
|
|
||||||
new_geo.height = new_geo.height + c->bw * 2;
|
|
||||||
fix_xwayland_coordinate(&new_geo);
|
|
||||||
|
|
||||||
resize(c,
|
resize(c,
|
||||||
(struct wlr_box){.x = new_geo.x,
|
(struct wlr_box){.x = event->x - c->bw,
|
||||||
.y = new_geo.y,
|
.y = event->y - c->bw,
|
||||||
.width = new_geo.width,
|
.width = event->width + c->bw * 2,
|
||||||
.height = new_geo.height},
|
.height = event->height + c->bw * 2},
|
||||||
0);
|
0);
|
||||||
} else {
|
} else {
|
||||||
arrange(c->mon, false, false);
|
arrange(c->mon, false, false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue