mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-05 04:06:28 -05:00
Compare commits
12 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e898417a7 | ||
|
|
65fcd58949 | ||
|
|
2bda8e3bf1 | ||
|
|
a4faf2c494 | ||
|
|
b0f839468c | ||
|
|
8ba259fbb7 | ||
|
|
16e361e1ca | ||
|
|
336f873d83 | ||
|
|
50b67ac539 | ||
|
|
0546a2d4c4 | ||
|
|
eb0607501d | ||
|
|
bcee63fa76 |
5 changed files with 485 additions and 180 deletions
|
|
@ -1054,20 +1054,11 @@ void client_set_focused_opacity_animation(Client *c) {
|
|||
sizeof(c->opacity_animation.target_border_color));
|
||||
c->opacity_animation.target_opacity = c->focused_opacity;
|
||||
c->opacity_animation.time_started = get_now_in_ms();
|
||||
if (c->opacity_animation.running) {
|
||||
memcpy(c->opacity_animation.initial_border_color,
|
||||
c->opacity_animation.current_border_color,
|
||||
sizeof(c->opacity_animation.initial_border_color));
|
||||
c->opacity_animation.initial_opacity =
|
||||
c->opacity_animation.current_opacity;
|
||||
} else {
|
||||
memcpy(c->opacity_animation.initial_border_color, bordercolor,
|
||||
sizeof(c->opacity_animation.initial_border_color));
|
||||
memcpy(c->opacity_animation.current_border_color, bordercolor,
|
||||
sizeof(c->opacity_animation.current_border_color));
|
||||
c->opacity_animation.initial_opacity = c->unfocused_opacity;
|
||||
c->opacity_animation.current_opacity = c->unfocused_opacity;
|
||||
}
|
||||
memcpy(c->opacity_animation.initial_border_color,
|
||||
c->opacity_animation.current_border_color,
|
||||
sizeof(c->opacity_animation.initial_border_color));
|
||||
c->opacity_animation.initial_opacity = c->opacity_animation.current_opacity;
|
||||
|
||||
c->opacity_animation.running = true;
|
||||
}
|
||||
|
||||
|
|
@ -1087,20 +1078,10 @@ void client_set_unfocused_opacity_animation(Client *c) {
|
|||
c->opacity_animation.target_opacity = c->unfocused_opacity;
|
||||
c->opacity_animation.time_started = get_now_in_ms();
|
||||
|
||||
if (c->opacity_animation.running) {
|
||||
memcpy(c->opacity_animation.initial_border_color,
|
||||
c->opacity_animation.current_border_color,
|
||||
sizeof(c->opacity_animation.initial_border_color));
|
||||
c->opacity_animation.initial_opacity =
|
||||
c->opacity_animation.current_opacity;
|
||||
} else {
|
||||
memcpy(c->opacity_animation.initial_border_color, border_color,
|
||||
sizeof(c->opacity_animation.initial_border_color));
|
||||
memcpy(c->opacity_animation.current_border_color, border_color,
|
||||
sizeof(c->opacity_animation.current_border_color));
|
||||
c->opacity_animation.initial_opacity = c->focused_opacity;
|
||||
c->opacity_animation.current_opacity = c->focused_opacity;
|
||||
}
|
||||
memcpy(c->opacity_animation.initial_border_color,
|
||||
c->opacity_animation.current_border_color,
|
||||
sizeof(c->opacity_animation.initial_border_color));
|
||||
c->opacity_animation.initial_opacity = c->opacity_animation.current_opacity;
|
||||
|
||||
c->opacity_animation.running = true;
|
||||
}
|
||||
|
|
@ -1135,6 +1116,10 @@ bool client_apply_focus_opacity(Client *c) {
|
|||
if (target_opacity > opacity) {
|
||||
target_opacity = opacity;
|
||||
}
|
||||
memcpy(c->opacity_animation.current_border_color,
|
||||
c->opacity_animation.target_border_color,
|
||||
sizeof(c->opacity_animation.current_border_color));
|
||||
c->opacity_animation.current_opacity = target_opacity;
|
||||
client_set_opacity(c, target_opacity);
|
||||
client_set_border_color(c, c->opacity_animation.target_border_color);
|
||||
} else if (animations && c->opacity_animation.running) {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -108,7 +108,8 @@ int32_t drag_warp_cursor = 1;
|
|||
int32_t xwayland_persistence = 1; /* xwayland persistence */
|
||||
int32_t syncobj_enable = 0;
|
||||
int32_t allow_lock_transparent = 0;
|
||||
double drag_refresh_interval = 16.0;
|
||||
double drag_tile_refresh_interval = 16.0;
|
||||
double drag_floating_refresh_interval = 8.0;
|
||||
int32_t allow_tearing = TEARING_DISABLED;
|
||||
int32_t allow_shortcuts_inhibit = SHORTCUTS_INHIBIT_ENABLE;
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ void resize_tile_master_horizontal(Client *grabc, bool isdrag, int32_t offsetx,
|
|||
}
|
||||
|
||||
if (last_apply_drap_time == 0 ||
|
||||
time - last_apply_drap_time > drag_refresh_interval) {
|
||||
time - last_apply_drap_time > drag_tile_refresh_interval) {
|
||||
arrange(grabc->mon, false, false);
|
||||
last_apply_drap_time = time;
|
||||
}
|
||||
|
|
@ -367,7 +367,7 @@ void resize_tile_master_vertical(Client *grabc, bool isdrag, int32_t offsetx,
|
|||
}
|
||||
|
||||
if (last_apply_drap_time == 0 ||
|
||||
time - last_apply_drap_time > drag_refresh_interval) {
|
||||
time - last_apply_drap_time > drag_tile_refresh_interval) {
|
||||
arrange(grabc->mon, false, false);
|
||||
last_apply_drap_time = time;
|
||||
}
|
||||
|
|
@ -548,7 +548,7 @@ void resize_tile_scroller(Client *grabc, bool isdrag, int32_t offsetx,
|
|||
}
|
||||
|
||||
if (last_apply_drap_time == 0 ||
|
||||
time - last_apply_drap_time > drag_refresh_interval) {
|
||||
time - last_apply_drap_time > drag_tile_refresh_interval) {
|
||||
arrange(grabc->mon, false, false);
|
||||
last_apply_drap_time = time;
|
||||
}
|
||||
|
|
|
|||
71
src/mango.c
71
src/mango.c
|
|
@ -969,7 +969,6 @@ static struct wlr_xwayland *xwayland;
|
|||
|
||||
void client_change_mon(Client *c, Monitor *m) {
|
||||
setmon(c, m, c->tags, true);
|
||||
reset_foreign_tolevel(c);
|
||||
if (c->isfloating) {
|
||||
c->float_geom = c->geom =
|
||||
setclient_coordinate_center(c, c->mon, c->geom, 0, 0);
|
||||
|
|
@ -1071,6 +1070,9 @@ void swallow(Client *c, Client *w) {
|
|||
c->tags = w->tags;
|
||||
c->geom = w->geom;
|
||||
c->float_geom = w->float_geom;
|
||||
c->stack_inner_per = w->stack_inner_per;
|
||||
c->master_inner_per = w->master_inner_per;
|
||||
c->master_mfact_per = w->master_mfact_per;
|
||||
c->scroller_proportion = w->scroller_proportion;
|
||||
c->next_in_stack = w->next_in_stack;
|
||||
c->prev_in_stack = w->prev_in_stack;
|
||||
|
|
@ -2023,7 +2025,6 @@ buttonpress(struct wl_listener *listener, void *data) {
|
|||
selmon = xytomon(cursor->x, cursor->y);
|
||||
client_update_oldmonname_record(grabc, selmon);
|
||||
setmon(grabc, selmon, 0, true);
|
||||
reset_foreign_tolevel(grabc);
|
||||
selmon->prevsel = ISTILED(selmon->sel) ? selmon->sel : NULL;
|
||||
selmon->sel = grabc;
|
||||
tmpc = grabc;
|
||||
|
|
@ -3825,6 +3826,12 @@ void init_client_properties(Client *c) {
|
|||
c->stack_proportion = 0.0f;
|
||||
c->next_in_stack = NULL;
|
||||
c->prev_in_stack = NULL;
|
||||
memcpy(c->opacity_animation.initial_border_color, bordercolor,
|
||||
sizeof(c->opacity_animation.initial_border_color));
|
||||
memcpy(c->opacity_animation.current_border_color, bordercolor,
|
||||
sizeof(c->opacity_animation.current_border_color));
|
||||
c->opacity_animation.initial_opacity = c->unfocused_opacity;
|
||||
c->opacity_animation.current_opacity = c->unfocused_opacity;
|
||||
}
|
||||
|
||||
void // old fix to 0.5
|
||||
|
|
@ -4143,7 +4150,7 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
|
|||
if (grabc->isfloating) {
|
||||
grabc->iscustomsize = 1;
|
||||
if (last_apply_drap_time == 0 ||
|
||||
time - last_apply_drap_time > drag_refresh_interval) {
|
||||
time - last_apply_drap_time > drag_floating_refresh_interval) {
|
||||
resize_floating_window(grabc);
|
||||
last_apply_drap_time = time;
|
||||
}
|
||||
|
|
@ -4672,6 +4679,7 @@ setfloating(Client *c, int32_t floating) {
|
|||
|
||||
Client *fc = NULL;
|
||||
struct wlr_box target_box;
|
||||
int32_t old_floating_state = c->isfloating;
|
||||
c->isfloating = floating;
|
||||
bool window_size_outofrange = false;
|
||||
|
||||
|
|
@ -4741,7 +4749,7 @@ setfloating(Client *c, int32_t floating) {
|
|||
layers[c->isfloating ? LyrTop : LyrTile]);
|
||||
}
|
||||
|
||||
if (!c->isfloating) {
|
||||
if (!c->isfloating && old_floating_state) {
|
||||
set_size_per(c->mon, c);
|
||||
}
|
||||
|
||||
|
|
@ -4790,6 +4798,7 @@ void setmaximizescreen(Client *c, int32_t maximizescreen) {
|
|||
if (c->mon->isoverview)
|
||||
return;
|
||||
|
||||
int32_t old_maximizescreen_state = c->ismaximizescreen;
|
||||
c->ismaximizescreen = maximizescreen;
|
||||
|
||||
if (maximizescreen) {
|
||||
|
|
@ -4819,7 +4828,7 @@ void setmaximizescreen(Client *c, int32_t maximizescreen) {
|
|||
|
||||
wlr_scene_node_reparent(&c->scene->node,
|
||||
layers[c->isfloating ? LyrTop : LyrTile]);
|
||||
if (!c->ismaximizescreen) {
|
||||
if (!c->ismaximizescreen && old_maximizescreen_state) {
|
||||
set_size_per(c->mon, c);
|
||||
}
|
||||
|
||||
|
|
@ -4852,6 +4861,7 @@ void setfullscreen(Client *c, int32_t fullscreen) // 用自定义全屏代理自
|
|||
if (c->mon->isoverview)
|
||||
return;
|
||||
|
||||
int32_t old_fullscreen_state = c->isfullscreen;
|
||||
c->isfullscreen = fullscreen;
|
||||
|
||||
client_set_fullscreen(c, fullscreen);
|
||||
|
|
@ -4889,7 +4899,7 @@ void setfullscreen(Client *c, int32_t fullscreen) // 用自定义全屏代理自
|
|||
layers[fullscreen || c->isfloating ? LyrTop : LyrTile]);
|
||||
}
|
||||
|
||||
if (!c->isfullscreen) {
|
||||
if (!c->isfullscreen && old_fullscreen_state) {
|
||||
set_size_per(c->mon, c);
|
||||
}
|
||||
|
||||
|
|
@ -5018,6 +5028,7 @@ void setmon(Client *c, Monitor *m, uint32_t newtags, bool focus) {
|
|||
arrange(oldmon, false, false);
|
||||
if (m) {
|
||||
/* Make sure window actually overlaps with the monitor */
|
||||
reset_foreign_tolevel(c);
|
||||
resize(c, c->geom, 0);
|
||||
c->tags =
|
||||
newtags ? newtags
|
||||
|
|
@ -5029,21 +5040,6 @@ void setmon(Client *c, Monitor *m, uint32_t newtags, bool focus) {
|
|||
if (focus && !client_is_x11_popup(c)) {
|
||||
focusclient(focustop(selmon), 1);
|
||||
}
|
||||
|
||||
if (m) {
|
||||
|
||||
if (c->foreign_toplevel) {
|
||||
remove_foreign_topleve(c);
|
||||
}
|
||||
|
||||
add_foreign_toplevel(c);
|
||||
if (m->sel && m->sel->foreign_toplevel)
|
||||
wlr_foreign_toplevel_handle_v1_set_activated(
|
||||
m->sel->foreign_toplevel, false);
|
||||
if (c->foreign_toplevel)
|
||||
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
void setpsel(struct wl_listener *listener, void *data) {
|
||||
|
|
@ -5798,7 +5794,8 @@ void updatemons(struct wl_listener *listener, void *data) {
|
|||
if (selmon && selmon->wlr_output->enabled) {
|
||||
wl_list_for_each(c, &clients, link) {
|
||||
if (!c->mon && client_surface(c)->mapped) {
|
||||
client_change_mon(c, selmon);
|
||||
c->mon = selmon;
|
||||
reset_foreign_tolevel(c);
|
||||
}
|
||||
}
|
||||
focusclient(focustop(selmon), 1);
|
||||
|
|
@ -6160,17 +6157,22 @@ int32_t main(int32_t argc, char *argv[]) {
|
|||
char *startup_cmd = NULL;
|
||||
int32_t c;
|
||||
|
||||
while ((c = getopt(argc, argv, "s:c:hdv")) != -1) {
|
||||
if (c == 's')
|
||||
while ((c = getopt(argc, argv, "s:c:hdvp")) != -1) {
|
||||
if (c == 's') {
|
||||
startup_cmd = optarg;
|
||||
else if (c == 'd')
|
||||
} else if (c == 'd') {
|
||||
log_level = WLR_DEBUG;
|
||||
else if (c == 'v')
|
||||
die("mango " VERSION);
|
||||
else if (c == 'c')
|
||||
} else if (c == 'v') {
|
||||
printf("mango " VERSION "\n");
|
||||
return EXIT_SUCCESS;
|
||||
} else if (c == 'c') {
|
||||
cli_config_path = optarg;
|
||||
else
|
||||
} else if (c == 'p') {
|
||||
parse_config();
|
||||
return EXIT_SUCCESS;
|
||||
} else {
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if (optind < argc)
|
||||
goto usage;
|
||||
|
|
@ -6184,7 +6186,14 @@ int32_t main(int32_t argc, char *argv[]) {
|
|||
run(startup_cmd);
|
||||
cleanup();
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
usage:
|
||||
die("Usage: %s [-v] [-d] [-c config file] [-s startup command]", argv[0]);
|
||||
printf("Usage: mango [OPTIONS]\n"
|
||||
"\n"
|
||||
"Options:\n"
|
||||
" -v Show mango version\n"
|
||||
" -d Enable debug log\n"
|
||||
" -c <file> Use custom configuration file\n"
|
||||
" -s <command> Execute startup command\n"
|
||||
" -p Check configuration file error\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue