mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-17 22:05:25 -05:00
Merge branch 'DreamMaoMao:main' into main
This commit is contained in:
commit
fa057ae342
3 changed files with 44 additions and 52 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) {
|
||||
|
|
|
|||
|
|
@ -822,8 +822,9 @@ KeySymCode parse_key(const char *key_str, bool isbindsym) {
|
|||
return kc;
|
||||
}
|
||||
|
||||
// 普通键名直接转换
|
||||
xkb_keysym_t sym = xkb_keysym_from_name(key_str, XKB_KEYSYM_NO_FLAGS);
|
||||
// change key string to keysym, case insensitive
|
||||
xkb_keysym_t sym =
|
||||
xkb_keysym_from_name(key_str, XKB_KEYSYM_CASE_INSENSITIVE);
|
||||
|
||||
if (isbindsym) {
|
||||
kc.type = KEY_TYPE_SYM;
|
||||
|
|
@ -940,6 +941,12 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
|||
char *arg_value5) {
|
||||
|
||||
FuncType func = NULL;
|
||||
(*arg).i = 0;
|
||||
(*arg).i2 = 0;
|
||||
(*arg).f = 0.0f;
|
||||
(*arg).f2 = 0.0f;
|
||||
(*arg).ui = 0;
|
||||
(*arg).ui2 = 0;
|
||||
(*arg).v = NULL;
|
||||
(*arg).v2 = NULL;
|
||||
(*arg).v3 = NULL;
|
||||
|
|
@ -2869,7 +2876,10 @@ void parse_config_file(Config *config, const char *file_path) {
|
|||
}
|
||||
|
||||
if (!file) {
|
||||
perror("Error opening file");
|
||||
fprintf(stderr,
|
||||
"\033[1;31m\033[1;33m[ERROR]:\033[0m Failed to open "
|
||||
"config file: %s\n",
|
||||
file_path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
39
src/mango.c
39
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
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue