opt: change unsigned int to uint32_t

This commit is contained in:
DreamMaoMao
2025-12-02 16:57:24 +08:00
parent 9196e2a50b
commit b9952f03b5
20 changed files with 314 additions and 329 deletions

View File

@@ -86,7 +86,7 @@ static void noop_description(void *data, struct wl_output *wl_output,
const char *description) {} const char *description) {}
// 将 n 转换为 9 位二进制字符串,结果存入 buf至少长度 10 // 将 n 转换为 9 位二进制字符串,结果存入 buf至少长度 10
void bin_str_9bits(char *buf, unsigned int n) { void bin_str_9bits(char *buf, uint32_t n) {
for (int i = 8; i >= 0; i--) { for (int i = 8; i >= 0; i--) {
*buf++ = ((n >> i) & 1) ? '1' : '0'; *buf++ = ((n >> i) & 1) ? '1' : '0';
} }
@@ -268,7 +268,7 @@ static void dwl_ipc_output_kb_layout(void *data,
static void static void
dwl_ipc_output_scalefactor(void *data, dwl_ipc_output_scalefactor(void *data,
struct zdwl_ipc_output_v2 *dwl_ipc_output, struct zdwl_ipc_output_v2 *dwl_ipc_output,
const unsigned int scalefactor) { const uint32_t scalefactor) {
if (!Aflag) if (!Aflag)
return; return;
char *output_name = data; char *output_name = data;

View File

@@ -1,4 +1,4 @@
void client_actual_size(Client *c, unsigned int *width, unsigned int *height) { void client_actual_size(Client *c, uint32_t *width, uint32_t *height) {
*width = c->animation.current.width - c->bw; *width = c->animation.current.width - c->bw;
*height = c->animation.current.height - c->bw; *height = c->animation.current.height - c->bw;
@@ -183,8 +183,8 @@ void scene_buffer_apply_effect(struct wlr_scene_buffer *buffer, int sx, int sy,
if (buffer_data->should_scale) { if (buffer_data->should_scale) {
unsigned int surface_width = surface->current.width; uint32_t surface_width = surface->current.width;
unsigned int surface_height = surface->current.height; uint32_t surface_height = surface->current.height;
surface_width = buffer_data->width_scale < 1 surface_width = buffer_data->width_scale < 1
? surface_width ? surface_width
@@ -270,7 +270,7 @@ void client_draw_shadow(Client *c) {
? CORNER_LOCATION_NONE ? CORNER_LOCATION_NONE
: CORNER_LOCATION_ALL; : CORNER_LOCATION_ALL;
unsigned int bwoffset = c->bw != 0 && hit_no_border ? c->bw : 0; uint32_t bwoffset = c->bw != 0 && hit_no_border ? c->bw : 0;
uint32_t width, height; uint32_t width, height;
client_actual_size(c, &width, &height); client_actual_size(c, &width, &height);
@@ -546,7 +546,7 @@ void client_apply_clip(Client *c, float factor) {
} }
// 获取窗口动画实时位置矩形 // 获取窗口动画实时位置矩形
unsigned int width, height; uint32_t width, height;
client_actual_size(c, &width, &height); client_actual_size(c, &width, &height);
// 计算出除了边框的窗口实际剪切大小 // 计算出除了边框的窗口实际剪切大小
@@ -630,17 +630,16 @@ void fadeout_client_animation_next_tick(Client *c) {
int type = c->animation.action = c->animation.action; int type = c->animation.action = c->animation.action;
double factor = find_animation_curve_at(animation_passed, type); double factor = find_animation_curve_at(animation_passed, type);
unsigned int width = uint32_t width = c->animation.initial.width +
c->animation.initial.width + (c->current.width - c->animation.initial.width) * factor;
(c->current.width - c->animation.initial.width) * factor; uint32_t height =
unsigned int height =
c->animation.initial.height + c->animation.initial.height +
(c->current.height - c->animation.initial.height) * factor; (c->current.height - c->animation.initial.height) * factor;
unsigned int x = c->animation.initial.x + uint32_t x = c->animation.initial.x +
(c->current.x - c->animation.initial.x) * factor; (c->current.x - c->animation.initial.x) * factor;
unsigned int y = c->animation.initial.y + uint32_t y = c->animation.initial.y +
(c->current.y - c->animation.initial.y) * factor; (c->current.y - c->animation.initial.y) * factor;
wlr_scene_node_set_position(&c->scene->node, x, y); wlr_scene_node_set_position(&c->scene->node, x, y);
@@ -696,17 +695,16 @@ void client_animation_next_tick(Client *c) {
double sx = 0, sy = 0; double sx = 0, sy = 0;
struct wlr_surface *surface = NULL; struct wlr_surface *surface = NULL;
unsigned int width = uint32_t width = c->animation.initial.width +
c->animation.initial.width + (c->current.width - c->animation.initial.width) * factor;
(c->current.width - c->animation.initial.width) * factor; uint32_t height =
unsigned int height =
c->animation.initial.height + c->animation.initial.height +
(c->current.height - c->animation.initial.height) * factor; (c->current.height - c->animation.initial.height) * factor;
unsigned int x = c->animation.initial.x + uint32_t x = c->animation.initial.x +
(c->current.x - c->animation.initial.x) * factor; (c->current.x - c->animation.initial.x) * factor;
unsigned int y = c->animation.initial.y + uint32_t y = c->animation.initial.y +
(c->current.y - c->animation.initial.y) * factor; (c->current.y - c->animation.initial.y) * factor;
wlr_scene_node_set_position(&c->scene->node, x, y); wlr_scene_node_set_position(&c->scene->node, x, y);
c->animation.current = (struct wlr_box){ c->animation.current = (struct wlr_box){

View File

@@ -33,33 +33,33 @@ void init_baked_points(void) {
baked_points_focus = baked_points_focus =
calloc(BAKED_POINTS_COUNT, sizeof(*baked_points_focus)); calloc(BAKED_POINTS_COUNT, sizeof(*baked_points_focus));
for (unsigned int i = 0; i < BAKED_POINTS_COUNT; i++) { for (uint32_t i = 0; i < BAKED_POINTS_COUNT; i++) {
baked_points_move[i] = calculate_animation_curve_at( baked_points_move[i] = calculate_animation_curve_at(
(double)i / (BAKED_POINTS_COUNT - 1), MOVE); (double)i / (BAKED_POINTS_COUNT - 1), MOVE);
} }
for (unsigned int i = 0; i < BAKED_POINTS_COUNT; i++) { for (uint32_t i = 0; i < BAKED_POINTS_COUNT; i++) {
baked_points_open[i] = calculate_animation_curve_at( baked_points_open[i] = calculate_animation_curve_at(
(double)i / (BAKED_POINTS_COUNT - 1), OPEN); (double)i / (BAKED_POINTS_COUNT - 1), OPEN);
} }
for (unsigned int i = 0; i < BAKED_POINTS_COUNT; i++) { for (uint32_t i = 0; i < BAKED_POINTS_COUNT; i++) {
baked_points_tag[i] = calculate_animation_curve_at( baked_points_tag[i] = calculate_animation_curve_at(
(double)i / (BAKED_POINTS_COUNT - 1), TAG); (double)i / (BAKED_POINTS_COUNT - 1), TAG);
} }
for (unsigned int i = 0; i < BAKED_POINTS_COUNT; i++) { for (uint32_t i = 0; i < BAKED_POINTS_COUNT; i++) {
baked_points_close[i] = calculate_animation_curve_at( baked_points_close[i] = calculate_animation_curve_at(
(double)i / (BAKED_POINTS_COUNT - 1), CLOSE); (double)i / (BAKED_POINTS_COUNT - 1), CLOSE);
} }
for (unsigned int i = 0; i < BAKED_POINTS_COUNT; i++) { for (uint32_t i = 0; i < BAKED_POINTS_COUNT; i++) {
baked_points_focus[i] = calculate_animation_curve_at( baked_points_focus[i] = calculate_animation_curve_at(
(double)i / (BAKED_POINTS_COUNT - 1), FOCUS); (double)i / (BAKED_POINTS_COUNT - 1), FOCUS);
} }
} }
double find_animation_curve_at(double t, int type) { double find_animation_curve_at(double t, int type) {
unsigned int down = 0; uint32_t down = 0;
unsigned int up = BAKED_POINTS_COUNT - 1; uint32_t up = BAKED_POINTS_COUNT - 1;
unsigned int middle = (up + down) / 2; uint32_t middle = (up + down) / 2;
struct dvec2 *baked_points; struct dvec2 *baked_points;
if (type == MOVE) { if (type == MOVE) {
baked_points = baked_points_move; baked_points = baked_points_move;

View File

@@ -1,5 +1,4 @@
void layer_actual_size(LayerSurface *l, unsigned int *width, void layer_actual_size(LayerSurface *l, uint32_t *width, uint32_t *height) {
unsigned int *height) {
struct wlr_box box; struct wlr_box box;
if (l->animation.running) { if (l->animation.running) {
@@ -213,9 +212,8 @@ void layer_scene_buffer_apply_effect(struct wlr_scene_buffer *buffer, int sx,
struct wlr_surface *surface = scene_surface->surface; struct wlr_surface *surface = scene_surface->surface;
unsigned int surface_width = uint32_t surface_width = surface->current.width * buffer_data->width_scale;
surface->current.width * buffer_data->width_scale; uint32_t surface_height =
unsigned int surface_height =
surface->current.height * buffer_data->height_scale; surface->current.height * buffer_data->height_scale;
if (surface_height > 0 && surface_width > 0) { if (surface_height > 0 && surface_width > 0) {
@@ -245,17 +243,16 @@ void fadeout_layer_animation_next_tick(LayerSurface *l) {
int type = l->animation.action = l->animation.action; int type = l->animation.action = l->animation.action;
double factor = find_animation_curve_at(animation_passed, type); double factor = find_animation_curve_at(animation_passed, type);
unsigned int width = uint32_t width = l->animation.initial.width +
l->animation.initial.width + (l->current.width - l->animation.initial.width) * factor;
(l->current.width - l->animation.initial.width) * factor; uint32_t height =
unsigned int height =
l->animation.initial.height + l->animation.initial.height +
(l->current.height - l->animation.initial.height) * factor; (l->current.height - l->animation.initial.height) * factor;
unsigned int x = l->animation.initial.x + uint32_t x = l->animation.initial.x +
(l->current.x - l->animation.initial.x) * factor; (l->current.x - l->animation.initial.x) * factor;
unsigned int y = l->animation.initial.y + uint32_t y = l->animation.initial.y +
(l->current.y - l->animation.initial.y) * factor; (l->current.y - l->animation.initial.y) * factor;
wlr_scene_node_set_position(&l->scene->node, x, y); wlr_scene_node_set_position(&l->scene->node, x, y);
@@ -310,17 +307,16 @@ void layer_animation_next_tick(LayerSurface *l) {
int type = l->animation.action == NONE ? MOVE : l->animation.action; int type = l->animation.action == NONE ? MOVE : l->animation.action;
double factor = find_animation_curve_at(animation_passed, type); double factor = find_animation_curve_at(animation_passed, type);
unsigned int width = uint32_t width = l->animation.initial.width +
l->animation.initial.width + (l->current.width - l->animation.initial.width) * factor;
(l->current.width - l->animation.initial.width) * factor; uint32_t height =
unsigned int height =
l->animation.initial.height + l->animation.initial.height +
(l->current.height - l->animation.initial.height) * factor; (l->current.height - l->animation.initial.height) * factor;
unsigned int x = l->animation.initial.x + uint32_t x = l->animation.initial.x +
(l->current.x - l->animation.initial.x) * factor; (l->current.x - l->animation.initial.x) * factor;
unsigned int y = l->animation.initial.y + uint32_t y = l->animation.initial.y +
(l->current.y - l->animation.initial.y) * factor; (l->current.y - l->animation.initial.y) * factor;
double opacity = MIN(fadein_begin_opacity + double opacity = MIN(fadein_begin_opacity +
animation_passed * (1.0 - fadein_begin_opacity), animation_passed * (1.0 - fadein_begin_opacity),

View File

@@ -526,16 +526,16 @@ static inline void client_set_size_bound(Client *c) {
if (!size_hints) if (!size_hints)
return; return;
if ((unsigned int)c->geom.width - 2 * c->bw < size_hints->min_width && if ((uint32_t)c->geom.width - 2 * c->bw < size_hints->min_width &&
size_hints->min_width > 0) size_hints->min_width > 0)
c->geom.width = size_hints->min_width + 2 * c->bw; c->geom.width = size_hints->min_width + 2 * c->bw;
if ((unsigned int)c->geom.height - 2 * c->bw < size_hints->min_height && if ((uint32_t)c->geom.height - 2 * c->bw < size_hints->min_height &&
size_hints->min_height > 0) size_hints->min_height > 0)
c->geom.height = size_hints->min_height + 2 * c->bw; c->geom.height = size_hints->min_height + 2 * c->bw;
if ((unsigned int)c->geom.width - 2 * c->bw > size_hints->max_width && if ((uint32_t)c->geom.width - 2 * c->bw > size_hints->max_width &&
size_hints->max_width > 0) size_hints->max_width > 0)
c->geom.width = size_hints->max_width + 2 * c->bw; c->geom.width = size_hints->max_width + 2 * c->bw;
if ((unsigned int)c->geom.height - 2 * c->bw > size_hints->max_height && if ((uint32_t)c->geom.height - 2 * c->bw > size_hints->max_height &&
size_hints->max_height > 0) size_hints->max_height > 0)
c->geom.height = size_hints->max_height + 2 * c->bw; c->geom.height = size_hints->max_height + 2 * c->bw;
return; return;
@@ -544,19 +544,19 @@ static inline void client_set_size_bound(Client *c) {
toplevel = c->surface.xdg->toplevel; toplevel = c->surface.xdg->toplevel;
state = toplevel->current; state = toplevel->current;
if ((unsigned int)c->geom.width - 2 * c->bw < state.min_width && if ((uint32_t)c->geom.width - 2 * c->bw < state.min_width &&
state.min_width > 0) { state.min_width > 0) {
c->geom.width = state.min_width + 2 * c->bw; c->geom.width = state.min_width + 2 * c->bw;
} }
if ((unsigned int)c->geom.height - 2 * c->bw < state.min_height && if ((uint32_t)c->geom.height - 2 * c->bw < state.min_height &&
state.min_height > 0) { state.min_height > 0) {
c->geom.height = state.min_height + 2 * c->bw; c->geom.height = state.min_height + 2 * c->bw;
} }
if ((unsigned int)c->geom.width - 2 * c->bw > state.max_width && if ((uint32_t)c->geom.width - 2 * c->bw > state.max_width &&
state.max_width > 0) { state.max_width > 0) {
c->geom.width = state.max_width + 2 * c->bw; c->geom.width = state.max_width + 2 * c->bw;
} }
if ((unsigned int)c->geom.height - 2 * c->bw > state.max_height && if ((uint32_t)c->geom.height - 2 * c->bw > state.max_height &&
state.max_height > 0) { state.max_height > 0) {
c->geom.height = state.max_height + 2 * c->bw; c->geom.height = state.max_height + 2 * c->bw;
} }

View File

@@ -82,14 +82,13 @@ void wl_list_append(struct wl_list *list, struct wl_list *object) {
wl_list_insert(list->prev, object); wl_list_insert(list->prev, object);
} }
unsigned int get_now_in_ms(void) { uint32_t get_now_in_ms(void) {
struct timespec now; struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now); clock_gettime(CLOCK_MONOTONIC, &now);
return timespec_to_ms(&now); return timespec_to_ms(&now);
} }
unsigned int timespec_to_ms(struct timespec *ts) { uint32_t timespec_to_ms(struct timespec *ts) {
return (unsigned int)ts->tv_sec * 1000 + return (uint32_t)ts->tv_sec * 1000 + (uint32_t)ts->tv_nsec / 1000000;
(unsigned int)ts->tv_nsec / 1000000;
} }

View File

@@ -6,5 +6,5 @@ void *ecalloc(size_t nmemb, size_t size);
int fd_set_nonblock(int fd); int fd_set_nonblock(int fd);
int regex_match(const char *pattern_mb, const char *str_mb); int regex_match(const char *pattern_mb, const char *str_mb);
void wl_list_append(struct wl_list *list, struct wl_list *object); void wl_list_append(struct wl_list *list, struct wl_list *object);
unsigned int get_now_in_ms(void); uint32_t get_now_in_ms(void);
unsigned int timespec_to_ms(struct timespec *ts); uint32_t timespec_to_ms(struct timespec *ts);

View File

@@ -52,7 +52,7 @@ typedef struct {
typedef struct { typedef struct {
const char *id; const char *id;
const char *title; const char *title;
unsigned int tags; uint32_t tags;
int isfloating; int isfloating;
int isfullscreen; int isfullscreen;
float scroller_proportion; float scroller_proportion;
@@ -124,29 +124,29 @@ KeyBinding default_key_bindings[] = {CHVT(1), CHVT(2), CHVT(3), CHVT(4),
CHVT(9), CHVT(10), CHVT(11), CHVT(12)}; CHVT(9), CHVT(10), CHVT(11), CHVT(12)};
typedef struct { typedef struct {
unsigned int mod; uint32_t mod;
unsigned int button; uint32_t button;
int (*func)(const Arg *); int (*func)(const Arg *);
Arg arg; Arg arg;
} MouseBinding; } MouseBinding;
typedef struct { typedef struct {
unsigned int mod; uint32_t mod;
unsigned int dir; uint32_t dir;
int (*func)(const Arg *); int (*func)(const Arg *);
Arg arg; Arg arg;
} AxisBinding; } AxisBinding;
typedef struct { typedef struct {
unsigned int fold; uint32_t fold;
int (*func)(const Arg *); int (*func)(const Arg *);
Arg arg; Arg arg;
} SwitchBinding; } SwitchBinding;
typedef struct { typedef struct {
unsigned int mod; uint32_t mod;
unsigned int motion; uint32_t motion;
unsigned int fingers_count; uint32_t fingers_count;
int (*func)(const Arg *); int (*func)(const Arg *);
Arg arg; Arg arg;
} GestureBinding; } GestureBinding;
@@ -210,7 +210,7 @@ typedef struct {
int snap_distance; int snap_distance;
int enable_floating_snap; int enable_floating_snap;
int drag_tile_to_tile; int drag_tile_to_tile;
unsigned int swipe_min_threshold; uint32_t swipe_min_threshold;
float focused_opacity; float focused_opacity;
float unfocused_opacity; float unfocused_opacity;
float *scroller_proportion_preset; float *scroller_proportion_preset;
@@ -219,21 +219,21 @@ typedef struct {
char **circle_layout; char **circle_layout;
int circle_layout_count; int circle_layout_count;
unsigned int new_is_master; uint32_t new_is_master;
float default_mfact; float default_mfact;
unsigned int default_nmaster; uint32_t default_nmaster;
int center_master_overspread; int center_master_overspread;
int center_when_single_stack; int center_when_single_stack;
unsigned int hotarea_size; uint32_t hotarea_size;
unsigned int enable_hotarea; uint32_t enable_hotarea;
unsigned int ov_tab_mode; uint32_t ov_tab_mode;
int overviewgappi; int overviewgappi;
int overviewgappo; int overviewgappo;
unsigned int cursor_hide_timeout; uint32_t cursor_hide_timeout;
unsigned int axis_bind_apply_timeout; uint32_t axis_bind_apply_timeout;
unsigned int focus_on_activate; uint32_t focus_on_activate;
int inhibit_regardless_of_visibility; int inhibit_regardless_of_visibility;
int sloppyfocus; int sloppyfocus;
int warpcursor; int warpcursor;
@@ -241,7 +241,7 @@ typedef struct {
/* keyboard */ /* keyboard */
int repeat_rate; int repeat_rate;
int repeat_delay; int repeat_delay;
unsigned int numlockon; uint32_t numlockon;
/* Trackpad */ /* Trackpad */
int disable_trackpad; int disable_trackpad;
@@ -253,13 +253,13 @@ typedef struct {
int disable_while_typing; int disable_while_typing;
int left_handed; int left_handed;
int middle_button_emulation; int middle_button_emulation;
unsigned int accel_profile; uint32_t accel_profile;
double accel_speed; double accel_speed;
unsigned int scroll_method; uint32_t scroll_method;
unsigned int scroll_button; uint32_t scroll_button;
unsigned int click_method; uint32_t click_method;
unsigned int send_events_mode; uint32_t send_events_mode;
unsigned int button_map; uint32_t button_map;
int blur; int blur;
int blur_layer; int blur_layer;
@@ -269,18 +269,18 @@ typedef struct {
int shadows; int shadows;
int shadow_only_floating; int shadow_only_floating;
int layer_shadows; int layer_shadows;
unsigned int shadows_size; uint32_t shadows_size;
float shadows_blur; float shadows_blur;
int shadows_position_x; int shadows_position_x;
int shadows_position_y; int shadows_position_y;
float shadowscolor[4]; float shadowscolor[4];
int smartgaps; int smartgaps;
unsigned int gappih; uint32_t gappih;
unsigned int gappiv; uint32_t gappiv;
unsigned int gappoh; uint32_t gappoh;
unsigned int gappov; uint32_t gappov;
unsigned int borderpx; uint32_t borderpx;
float scratchpad_width_ratio; float scratchpad_width_ratio;
float scratchpad_height_ratio; float scratchpad_height_ratio;
float rootcolor[4]; float rootcolor[4];
@@ -331,7 +331,7 @@ typedef struct {
int exec_once_count; int exec_once_count;
char *cursor_theme; char *cursor_theme;
unsigned int cursor_size; uint32_t cursor_size;
int single_scratchpad; int single_scratchpad;
int xwayland_persistence; int xwayland_persistence;
@@ -789,7 +789,7 @@ void convert_hex_to_rgba(float *color, unsigned long int hex) {
color[3] = (hex & 0xFF) / 255.0f; color[3] = (hex & 0xFF) / 255.0f;
} }
unsigned int parse_num_type(char *str) { uint32_t parse_num_type(char *str) {
switch (str[0]) { switch (str[0]) {
case '-': case '-':
return NUM_TYPE_MINUS; return NUM_TYPE_MINUS;

View File

@@ -33,27 +33,27 @@ double animation_curve_close[4] = {0.46, 1.0, 0.29, 0.99}; // 动画曲线
double animation_curve_focus[4] = {0.46, 1.0, 0.29, 0.99}; // 动画曲线 double animation_curve_focus[4] = {0.46, 1.0, 0.29, 0.99}; // 动画曲线
/* appearance */ /* appearance */
unsigned int axis_bind_apply_timeout = 100; // 滚轮绑定动作的触发的时间间隔 uint32_t axis_bind_apply_timeout = 100; // 滚轮绑定动作的触发的时间间隔
unsigned int focus_on_activate = 1; // 收到窗口激活请求是否自动跳转聚焦 uint32_t focus_on_activate = 1; // 收到窗口激活请求是否自动跳转聚焦
unsigned int new_is_master = 1; // 新窗口是否插在头部 uint32_t new_is_master = 1; // 新窗口是否插在头部
double default_mfact = 0.55f; // master 窗口比例 double default_mfact = 0.55f; // master 窗口比例
unsigned int default_nmaster = 1; // 默认master数量 uint32_t default_nmaster = 1; // 默认master数量
int center_master_overspread = 0; // 中心master时是否铺满 int center_master_overspread = 0; // 中心master时是否铺满
int center_when_single_stack = 1; // 单个stack时是否居中 int center_when_single_stack = 1; // 单个stack时是否居中
/* logging */ /* logging */
int log_level = WLR_ERROR; int log_level = WLR_ERROR;
unsigned int numlockon = 0; // 是否打开右边小键盘 uint32_t numlockon = 0; // 是否打开右边小键盘
unsigned int capslock = 0; // 是否启用快捷键 uint32_t capslock = 0; // 是否启用快捷键
unsigned int ov_tab_mode = 0; // alt tab切换模式 uint32_t ov_tab_mode = 0; // alt tab切换模式
unsigned int hotarea_size = 10; // 热区大小,10x10 uint32_t hotarea_size = 10; // 热区大小,10x10
unsigned int enable_hotarea = 1; // 是否启用鼠标热区 uint32_t enable_hotarea = 1; // 是否启用鼠标热区
int smartgaps = 0; /* 1 means no outer gap when there is only one window */ int smartgaps = 0; /* 1 means no outer gap when there is only one window */
int sloppyfocus = 1; /* focus follows mouse */ int sloppyfocus = 1; /* focus follows mouse */
unsigned int gappih = 5; /* horiz inner gap between windows */ uint32_t gappih = 5; /* horiz inner gap between windows */
unsigned int gappiv = 5; /* vert inner gap between windows */ uint32_t gappiv = 5; /* vert inner gap between windows */
unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ uint32_t gappoh = 10; /* horiz outer gap between windows and screen edge */
unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ uint32_t gappov = 10; /* vert outer gap between windows and screen edge */
float scratchpad_width_ratio = 0.8; float scratchpad_width_ratio = 0.8;
float scratchpad_height_ratio = 0.9; float scratchpad_height_ratio = 0.9;
@@ -73,15 +73,15 @@ int no_radius_when_single = 0;
int snap_distance = 30; int snap_distance = 30;
int enable_floating_snap = 0; int enable_floating_snap = 0;
int drag_tile_to_tile = 0; int drag_tile_to_tile = 0;
unsigned int cursor_size = 24; uint32_t cursor_size = 24;
unsigned int cursor_hide_timeout = 0; uint32_t cursor_hide_timeout = 0;
unsigned int swipe_min_threshold = 1; uint32_t swipe_min_threshold = 1;
int inhibit_regardless_of_visibility = int inhibit_regardless_of_visibility =
0; /* 1 means idle inhibitors will disable idle tracking even if it's 0; /* 1 means idle inhibitors will disable idle tracking even if it's
surface isn't visible */ surface isn't visible */
unsigned int borderpx = 4; /* border pixel of windows */ uint32_t borderpx = 4; /* border pixel of windows */
float rootcolor[] = COLOR(0x323232ff); float rootcolor[] = COLOR(0x323232ff);
float bordercolor[] = COLOR(0x444444ff); float bordercolor[] = COLOR(0x444444ff);
float focuscolor[] = COLOR(0xc66b25ff); float focuscolor[] = COLOR(0xc66b25ff);
@@ -166,7 +166,7 @@ LIBINPUT_CONFIG_SCROLL_EDGE
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
*/ */
enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG; enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
unsigned int scroll_button = 274; uint32_t scroll_button = 274;
/* You can choose between: /* You can choose between:
LIBINPUT_CONFIG_CLICK_METHOD_NONE LIBINPUT_CONFIG_CLICK_METHOD_NONE
@@ -224,7 +224,7 @@ float blur_params_saturation = 1.2;
int shadows = 0; int shadows = 0;
int shadow_only_floating = 1; int shadow_only_floating = 1;
int layer_shadows = 0; int layer_shadows = 0;
unsigned int shadows_size = 10; uint32_t shadows_size = 10;
double shadows_blur = 15; double shadows_blur = 15;
int shadows_position_x = 0; int shadows_position_x = 0;
int shadows_position_y = 0; int shadows_position_y = 0;

View File

@@ -1,6 +1,6 @@
int bind_to_view(const Arg *arg) { int bind_to_view(const Arg *arg) {
unsigned int target = arg->ui; uint32_t target = arg->ui;
if (view_current_to_back && selmon->pertag->curtag && if (view_current_to_back && selmon->pertag->curtag &&
(target & TAGMASK) == (selmon->tagset[selmon->seltags])) { (target & TAGMASK) == (selmon->tagset[selmon->seltags])) {
@@ -130,7 +130,7 @@ int focuslast(const Arg *arg) {
Client *c = NULL; Client *c = NULL;
Client *tc = NULL; Client *tc = NULL;
bool begin = false; bool begin = false;
unsigned int target = 0; uint32_t target = 0;
wl_list_for_each(c, &fstack, flink) { wl_list_for_each(c, &fstack, flink) {
if (c->iskilling || c->isminimized || c->isunglobal || if (c->iskilling || c->isminimized || c->isunglobal ||
@@ -531,7 +531,7 @@ int set_proportion(const Arg *arg) {
return 0; return 0;
if (selmon->sel) { if (selmon->sel) {
unsigned int max_client_width = uint32_t max_client_width =
selmon->w.width - 2 * scroller_structs - gappih; selmon->w.width - 2 * scroller_structs - gappih;
selmon->sel->scroller_proportion = arg->f; selmon->sel->scroller_proportion = arg->f;
selmon->sel->geom.width = max_client_width * arg->f; selmon->sel->geom.width = max_client_width * arg->f;
@@ -837,9 +837,9 @@ int switch_keyboard_layout(const Arg *arg) {
xkb_layout_index_t next = (current + 1) % num_layouts; xkb_layout_index_t next = (current + 1) % num_layouts;
// 6. 应用新 keymap // 6. 应用新 keymap
unsigned int depressed = keyboard->modifiers.depressed; uint32_t depressed = keyboard->modifiers.depressed;
unsigned int latched = keyboard->modifiers.latched; uint32_t latched = keyboard->modifiers.latched;
unsigned int locked = keyboard->modifiers.locked; uint32_t locked = keyboard->modifiers.locked;
wlr_keyboard_set_keymap(keyboard, keyboard->keymap); wlr_keyboard_set_keymap(keyboard, keyboard->keymap);
wlr_keyboard_notify_modifiers(keyboard, depressed, latched, locked, next); wlr_keyboard_notify_modifiers(keyboard, depressed, latched, locked, next);
@@ -874,7 +874,7 @@ int switch_layout(const Arg *arg) {
int jk, ji; int jk, ji;
char *target_layout_name = NULL; char *target_layout_name = NULL;
unsigned int len; uint32_t len;
if (config.circle_layout_count != 0) { if (config.circle_layout_count != 0) {
for (jk = 0; jk < config.circle_layout_count; jk++) { for (jk = 0; jk < config.circle_layout_count; jk++) {
@@ -959,7 +959,7 @@ int switch_proportion_preset(const Arg *arg) {
target_proportion = config.scroller_proportion_preset[0]; target_proportion = config.scroller_proportion_preset[0];
} }
unsigned int max_client_width = uint32_t max_client_width =
selmon->w.width - 2 * scroller_structs - gappih; selmon->w.width - 2 * scroller_structs - gappih;
selmon->sel->scroller_proportion = target_proportion; selmon->sel->scroller_proportion = target_proportion;
selmon->sel->geom.width = max_client_width * target_proportion; selmon->sel->geom.width = max_client_width * target_proportion;
@@ -1001,8 +1001,8 @@ int tagmon(const Arg *arg) {
if (!m || !m->wlr_output->enabled) if (!m || !m->wlr_output->enabled)
return 0; return 0;
unsigned int newtags = arg->ui ? arg->ui : arg->i2 ? c->tags : 0; uint32_t newtags = arg->ui ? arg->ui : arg->i2 ? c->tags : 0;
unsigned int target; uint32_t target;
if (c->mon == m) { if (c->mon == m) {
view(&(Arg){.ui = newtags}, true); view(&(Arg){.ui = newtags}, true);
@@ -1242,7 +1242,7 @@ int toggleoverlay(const Arg *arg) {
} }
int toggletag(const Arg *arg) { int toggletag(const Arg *arg) {
unsigned int newtags; uint32_t newtags;
Client *sel = focustop(selmon); Client *sel = focustop(selmon);
if (!sel) if (!sel)
return 0; return 0;
@@ -1265,8 +1265,8 @@ int toggletag(const Arg *arg) {
} }
int toggleview(const Arg *arg) { int toggleview(const Arg *arg) {
unsigned int newtagset; uint32_t newtagset;
unsigned int target; uint32_t target;
target = arg->ui == 0 ? ~0 & TAGMASK : arg->ui; target = arg->ui == 0 ? ~0 & TAGMASK : arg->ui;
@@ -1283,7 +1283,7 @@ int toggleview(const Arg *arg) {
} }
int viewtoleft(const Arg *arg) { int viewtoleft(const Arg *arg) {
unsigned int target = selmon->tagset[selmon->seltags]; uint32_t target = selmon->tagset[selmon->seltags];
if (selmon->isoverview || selmon->pertag->curtag == 0) { if (selmon->isoverview || selmon->pertag->curtag == 0) {
return 0; return 0;
@@ -1306,7 +1306,7 @@ int viewtoright(const Arg *arg) {
if (selmon->isoverview || selmon->pertag->curtag == 0) { if (selmon->isoverview || selmon->pertag->curtag == 0) {
return 0; return 0;
} }
unsigned int target = selmon->tagset[selmon->seltags]; uint32_t target = selmon->tagset[selmon->seltags];
target <<= 1; target <<= 1;
if (!selmon || (target) == selmon->tagset[selmon->seltags]) if (!selmon || (target) == selmon->tagset[selmon->seltags])
@@ -1320,9 +1320,8 @@ int viewtoright(const Arg *arg) {
} }
int viewtoleft_have_client(const Arg *arg) { int viewtoleft_have_client(const Arg *arg) {
unsigned int n; uint32_t n;
unsigned int current = uint32_t current = get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
bool found = false; bool found = false;
if (selmon->isoverview) { if (selmon->isoverview) {
@@ -1345,9 +1344,8 @@ int viewtoleft_have_client(const Arg *arg) {
} }
int viewtoright_have_client(const Arg *arg) { int viewtoright_have_client(const Arg *arg) {
unsigned int n; uint32_t n;
unsigned int current = uint32_t current = get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
bool found = false; bool found = false;
if (selmon->isoverview) { if (selmon->isoverview) {
@@ -1384,7 +1382,7 @@ int tagcrossmon(const Arg *arg) {
} }
int comboview(const Arg *arg) { int comboview(const Arg *arg) {
unsigned int newtags = arg->ui & TAGMASK; uint32_t newtags = arg->ui & TAGMASK;
if (!newtags || !selmon) if (!newtags || !selmon)
return 0; return 0;
@@ -1462,8 +1460,8 @@ int toggleoverview(const Arg *arg) {
} }
selmon->isoverview ^= 1; selmon->isoverview ^= 1;
unsigned int target; uint32_t target;
unsigned int visible_client_number = 0; uint32_t visible_client_number = 0;
if (selmon->isoverview) { if (selmon->isoverview) {
wl_list_for_each(c, &clients, link) if (c && c->mon == selmon && wl_list_for_each(c, &clients, link) if (c && c->mon == selmon &&

View File

@@ -1,12 +1,11 @@
#include "dwl-ipc-unstable-v2-protocol.h" #include "dwl-ipc-unstable-v2-protocol.h"
static void dwl_ipc_manager_bind(struct wl_client *client, void *data, static void dwl_ipc_manager_bind(struct wl_client *client, void *data,
unsigned int version, unsigned int id); uint32_t version, uint32_t id);
static void dwl_ipc_manager_destroy(struct wl_resource *resource); static void dwl_ipc_manager_destroy(struct wl_resource *resource);
static void dwl_ipc_manager_get_output(struct wl_client *client, static void dwl_ipc_manager_get_output(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
unsigned int id, uint32_t id, struct wl_resource *output);
struct wl_resource *output);
static void dwl_ipc_manager_release(struct wl_client *client, static void dwl_ipc_manager_release(struct wl_client *client,
struct wl_resource *resource); struct wl_resource *resource);
static void dwl_ipc_output_destroy(struct wl_resource *resource); static void dwl_ipc_output_destroy(struct wl_resource *resource);
@@ -15,15 +14,14 @@ static void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output,
uint32_t event_mask); uint32_t event_mask);
static void dwl_ipc_output_set_client_tags(struct wl_client *client, static void dwl_ipc_output_set_client_tags(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
unsigned int and_tags, uint32_t and_tags,
unsigned int xor_tags); uint32_t xor_tags);
static void dwl_ipc_output_set_layout(struct wl_client *client, static void dwl_ipc_output_set_layout(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
unsigned int index); uint32_t index);
static void dwl_ipc_output_set_tags(struct wl_client *client, static void dwl_ipc_output_set_tags(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
unsigned int tagmask, uint32_t tagmask, uint32_t toggle_tagset);
unsigned int toggle_tagset);
static void dwl_ipc_output_quit(struct wl_client *client, static void dwl_ipc_output_quit(struct wl_client *client,
struct wl_resource *resource); struct wl_resource *resource);
static void dwl_ipc_output_dispatch(struct wl_client *client, static void dwl_ipc_output_dispatch(struct wl_client *client,
@@ -47,7 +45,7 @@ static struct zdwl_ipc_output_v2_interface dwl_output_implementation = {
.set_client_tags = dwl_ipc_output_set_client_tags}; .set_client_tags = dwl_ipc_output_set_client_tags};
void dwl_ipc_manager_bind(struct wl_client *client, void *data, void dwl_ipc_manager_bind(struct wl_client *client, void *data,
unsigned int version, unsigned int id) { uint32_t version, uint32_t id) {
struct wl_resource *manager_resource = struct wl_resource *manager_resource =
wl_resource_create(client, &zdwl_ipc_manager_v2_interface, version, id); wl_resource_create(client, &zdwl_ipc_manager_v2_interface, version, id);
if (!manager_resource) { if (!manager_resource) {
@@ -60,7 +58,7 @@ void dwl_ipc_manager_bind(struct wl_client *client, void *data,
zdwl_ipc_manager_v2_send_tags(manager_resource, LENGTH(tags)); zdwl_ipc_manager_v2_send_tags(manager_resource, LENGTH(tags));
for (unsigned int i = 0; i < LENGTH(layouts); i++) for (uint32_t i = 0; i < LENGTH(layouts); i++)
zdwl_ipc_manager_v2_send_layout(manager_resource, layouts[i].symbol); zdwl_ipc_manager_v2_send_layout(manager_resource, layouts[i].symbol);
} }
@@ -69,7 +67,7 @@ void dwl_ipc_manager_destroy(struct wl_resource *resource) {
} }
void dwl_ipc_manager_get_output(struct wl_client *client, void dwl_ipc_manager_get_output(struct wl_client *client,
struct wl_resource *resource, unsigned int id, struct wl_resource *resource, uint32_t id,
struct wl_resource *output) { struct wl_resource *output) {
DwlIpcOutput *ipc_output; DwlIpcOutput *ipc_output;
struct wlr_output *op = wlr_output_from_resource(output); struct wlr_output *op = wlr_output_from_resource(output);
@@ -292,12 +290,11 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output,
void dwl_ipc_output_set_client_tags(struct wl_client *client, void dwl_ipc_output_set_client_tags(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
unsigned int and_tags, uint32_t and_tags, uint32_t xor_tags) {
unsigned int xor_tags) {
DwlIpcOutput *ipc_output; DwlIpcOutput *ipc_output;
Monitor *monitor = NULL; Monitor *monitor = NULL;
Client *selected_client = NULL; Client *selected_client = NULL;
unsigned int newtags = 0; uint32_t newtags = 0;
ipc_output = wl_resource_get_user_data(resource); ipc_output = wl_resource_get_user_data(resource);
if (!ipc_output) if (!ipc_output)
@@ -320,8 +317,7 @@ void dwl_ipc_output_set_client_tags(struct wl_client *client,
} }
void dwl_ipc_output_set_layout(struct wl_client *client, void dwl_ipc_output_set_layout(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource, uint32_t index) {
unsigned int index) {
DwlIpcOutput *ipc_output; DwlIpcOutput *ipc_output;
Monitor *monitor = NULL; Monitor *monitor = NULL;
@@ -340,11 +336,11 @@ void dwl_ipc_output_set_layout(struct wl_client *client,
} }
void dwl_ipc_output_set_tags(struct wl_client *client, void dwl_ipc_output_set_tags(struct wl_client *client,
struct wl_resource *resource, unsigned int tagmask, struct wl_resource *resource, uint32_t tagmask,
unsigned int toggle_tagset) { uint32_t toggle_tagset) {
DwlIpcOutput *ipc_output; DwlIpcOutput *ipc_output;
Monitor *monitor = NULL; Monitor *monitor = NULL;
unsigned int newtags = tagmask & TAGMASK; uint32_t newtags = tagmask & TAGMASK;
ipc_output = wl_resource_get_user_data(resource); ipc_output = wl_resource_get_user_data(resource);
if (!ipc_output) if (!ipc_output)

View File

@@ -8,7 +8,7 @@ typedef struct Monitor Monitor;
struct workspace { struct workspace {
struct wl_list link; // Link in global workspaces list struct wl_list link; // Link in global workspaces list
unsigned int tag; // Numeric identifier (1-9, 0=overview) uint32_t tag; // Numeric identifier (1-9, 0=overview)
Monitor *m; // Associated monitor Monitor *m; // Associated monitor
struct wlr_ext_workspace_handle_v1 *ext_workspace; // Protocol object struct wlr_ext_workspace_handle_v1 *ext_workspace; // Protocol object
/* Event listeners */ /* Event listeners */
@@ -22,7 +22,7 @@ struct wlr_ext_workspace_manager_v1 *ext_manager;
struct wl_list workspaces; struct wl_list workspaces;
void goto_workspace(struct workspace *target) { void goto_workspace(struct workspace *target) {
unsigned int tag; uint32_t tag;
tag = 1 << (target->tag - 1); tag = 1 << (target->tag - 1);
if (target->tag == 0) { if (target->tag == 0) {
toggleoverview(&(Arg){.i = -1}); toggleoverview(&(Arg){.i = -1});
@@ -33,7 +33,7 @@ void goto_workspace(struct workspace *target) {
} }
void toggle_workspace(struct workspace *target) { void toggle_workspace(struct workspace *target) {
unsigned int tag; uint32_t tag;
tag = 1 << (target->tag - 1); tag = 1 << (target->tag - 1);
if (target->tag == 0) { if (target->tag == 0) {
toggleview(&(Arg){.i = -1}); toggleview(&(Arg){.i = -1});
@@ -69,7 +69,7 @@ static void handle_ext_workspace_deactivate(struct wl_listener *listener,
wlr_log(WLR_INFO, "ext deactivating workspace %d", workspace->tag); wlr_log(WLR_INFO, "ext deactivating workspace %d", workspace->tag);
} }
static const char *get_name_from_tag(unsigned int tag) { static const char *get_name_from_tag(uint32_t tag) {
static const char *names[] = {"overview", "1", "2", "3", "4", static const char *names[] = {"overview", "1", "2", "3", "4",
"5", "6", "7", "8", "9"}; "5", "6", "7", "8", "9"};
return (tag < sizeof(names) / sizeof(names[0])) ? names[tag] : NULL; return (tag < sizeof(names) / sizeof(names[0])) ? names[tag] : NULL;
@@ -92,7 +92,7 @@ void cleanup_workspaces_by_monitor(Monitor *m) {
} }
} }
static void remove_workspace_by_tag(unsigned int tag, Monitor *m) { static void remove_workspace_by_tag(uint32_t tag, Monitor *m) {
struct workspace *workspace, *tmp; struct workspace *workspace, *tmp;
wl_list_for_each_safe(workspace, tmp, &workspaces, link) { wl_list_for_each_safe(workspace, tmp, &workspaces, link) {
if (workspace->tag == tag && workspace->m == m) { if (workspace->tag == tag && workspace->m == m) {
@@ -127,7 +127,7 @@ static void add_workspace_by_tag(int tag, Monitor *m) {
void dwl_ext_workspace_printstatus(Monitor *m) { void dwl_ext_workspace_printstatus(Monitor *m) {
struct workspace *w; struct workspace *w;
unsigned int tag_status = 0; uint32_t tag_status = 0;
wl_list_for_each(w, &workspaces, link) { wl_list_for_each(w, &workspaces, link) {
if (w && w->m == m) { if (w && w->m == m) {

View File

@@ -4,7 +4,7 @@ static struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager;
void handle_foreign_activate_request(struct wl_listener *listener, void *data) { void handle_foreign_activate_request(struct wl_listener *listener, void *data) {
Client *c = wl_container_of(listener, c, foreign_activate_request); Client *c = wl_container_of(listener, c, foreign_activate_request);
unsigned int target; uint32_t target;
if (c && c->swallowing) if (c && c->swallowing)
return; return;

View File

@@ -70,7 +70,7 @@ setclient_coordinate_center(Client *c, struct wlr_box geom, int offsetx,
int len = 0; int len = 0;
Monitor *m = c->mon ? c->mon : selmon; Monitor *m = c->mon ? c->mon : selmon;
unsigned int cbw = check_hit_no_border(c) ? c->bw : 0; uint32_t cbw = check_hit_no_border(c) ? c->bw : 0;
if (!c->no_force_center) { if (!c->no_force_center) {
tempbox.x = m->w.x + (m->w.width - geom.width) / 2; tempbox.x = m->w.x + (m->w.width - geom.width) / 2;

View File

@@ -1,5 +1,5 @@
pid_t getparentprocess(pid_t p) { pid_t getparentprocess(pid_t p) {
unsigned int v = 0; uint32_t v = 0;
FILE *f; FILE *f;
char buf[256]; char buf[256];
@@ -26,7 +26,7 @@ int isdescprocess(pid_t p, pid_t c) {
return (int)c; return (int)c;
} }
char *get_autostart_path(char *autostart_path, unsigned int buf_size) { char *get_autostart_path(char *autostart_path, uint32_t buf_size) {
const char *mangoconfig = getenv("MANGOCONFIG"); const char *mangoconfig = getenv("MANGOCONFIG");
if (mangoconfig && mangoconfig[0] != '\0') { if (mangoconfig && mangoconfig[0] != '\0') {
@@ -60,10 +60,10 @@ void get_layout_abbr(char *abbr, const char *full_name) {
const char *open = strrchr(full_name, '('); const char *open = strrchr(full_name, '(');
const char *close = strrchr(full_name, ')'); const char *close = strrchr(full_name, ')');
if (open && close && close > open) { if (open && close && close > open) {
unsigned int len = close - open - 1; uint32_t len = close - open - 1;
if (len > 0 && len <= 4) { if (len > 0 && len <= 4) {
// 提取并转换为小写 // 提取并转换为小写
for (unsigned int j = 0; j < len; j++) { for (uint32_t j = 0; j < len; j++) {
abbr[j] = tolower(open[j + 1]); abbr[j] = tolower(open[j + 1]);
} }
abbr[len] = '\0'; abbr[len] = '\0';
@@ -72,8 +72,8 @@ void get_layout_abbr(char *abbr, const char *full_name) {
} }
// 3. 提取前2-3个字母并转换为小写 // 3. 提取前2-3个字母并转换为小写
unsigned int j = 0; uint32_t j = 0;
for (unsigned int i = 0; full_name[i] != '\0' && j < 3; i++) { for (uint32_t i = 0; full_name[i] != '\0' && j < 3; i++) {
if (isalpha(full_name[i])) { if (isalpha(full_name[i])) {
abbr[j++] = tolower(full_name[i]); abbr[j++] = tolower(full_name[i]);
} }

View File

@@ -26,9 +26,9 @@ bool is_scroller_layout(Monitor *m) {
return false; return false;
} }
unsigned int get_tag_status(unsigned int tag, Monitor *m) { uint32_t get_tag_status(uint32_t tag, Monitor *m) {
Client *c = NULL; Client *c = NULL;
unsigned int status = 0; uint32_t status = 0;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (c->mon == m && c->tags & 1 << (tag - 1) & TAGMASK) { if (c->mon == m && c->tags & 1 << (tag - 1) & TAGMASK) {
if (c->isurgent) { if (c->isurgent) {
@@ -41,8 +41,8 @@ unsigned int get_tag_status(unsigned int tag, Monitor *m) {
return status; return status;
} }
unsigned int get_tags_first_tag_num(unsigned int source_tags) { uint32_t get_tags_first_tag_num(uint32_t source_tags) {
unsigned int i, tag; uint32_t i, tag;
tag = 0; tag = 0;
if (!source_tags) { if (!source_tags) {
@@ -63,8 +63,8 @@ unsigned int get_tags_first_tag_num(unsigned int source_tags) {
} }
// 获取tags中最前面的tag的tagmask // 获取tags中最前面的tag的tagmask
unsigned int get_tags_first_tag(unsigned int source_tags) { uint32_t get_tags_first_tag(uint32_t source_tags) {
unsigned int i, tag; uint32_t i, tag;
tag = 0; tag = 0;
if (!source_tags) { if (!source_tags) {

View File

@@ -19,7 +19,7 @@ void set_size_per(Monitor *m, Client *c) {
} }
void resize_tile_master_horizontal(Client *grabc, bool isdrag, int offsetx, void resize_tile_master_horizontal(Client *grabc, bool isdrag, int offsetx,
int offsety, unsigned int time, int type) { int offsety, uint32_t time, int type) {
Client *tc = NULL; Client *tc = NULL;
float delta_x, delta_y; float delta_x, delta_y;
Client *next = NULL; Client *next = NULL;
@@ -213,7 +213,7 @@ void resize_tile_master_horizontal(Client *grabc, bool isdrag, int offsetx,
} }
void resize_tile_master_vertical(Client *grabc, bool isdrag, int offsetx, void resize_tile_master_vertical(Client *grabc, bool isdrag, int offsetx,
int offsety, unsigned int time, int type) { int offsety, uint32_t time, int type) {
Client *tc = NULL; Client *tc = NULL;
float delta_x, delta_y; float delta_x, delta_y;
Client *next = NULL; Client *next = NULL;
@@ -370,7 +370,7 @@ void resize_tile_master_vertical(Client *grabc, bool isdrag, int offsetx,
} }
void resize_tile_scroller(Client *grabc, bool isdrag, int offsetx, int offsety, void resize_tile_scroller(Client *grabc, bool isdrag, int offsetx, int offsety,
unsigned int time, bool isvertical) { uint32_t time, bool isvertical) {
float delta_x, delta_y; float delta_x, delta_y;
float new_scroller_proportion; float new_scroller_proportion;
@@ -474,7 +474,7 @@ void resize_tile_scroller(Client *grabc, bool isdrag, int offsetx, int offsety,
} }
void resize_tile_client(Client *grabc, bool isdrag, int offsetx, int offsety, void resize_tile_client(Client *grabc, bool isdrag, int offsetx, int offsety,
unsigned int time) { uint32_t time) {
if (!grabc || grabc->isfullscreen || grabc->ismaximizescreen) if (!grabc || grabc->isfullscreen || grabc->ismaximizescreen)
return; return;
@@ -509,8 +509,8 @@ void reset_size_per_mon(Monitor *m, int tile_cilent_num,
int stack_num) { int stack_num) {
Client *c = NULL; Client *c = NULL;
int i = 0; int i = 0;
unsigned int stack_index = 0; uint32_t stack_index = 0;
unsigned int nmasters = m->pertag->nmasters[m->pertag->curtag]; uint32_t nmasters = m->pertag->nmasters[m->pertag->curtag];
if (m->pertag->ltidxs[m->pertag->curtag]->id != CENTER_TILE) { if (m->pertag->ltidxs[m->pertag->curtag]->id != CENTER_TILE) {

View File

@@ -1,9 +1,9 @@
// 网格布局窗口大小和位置计算 // 网格布局窗口大小和位置计算
void grid(Monitor *m) { void grid(Monitor *m) {
unsigned int i, n; uint32_t i, n;
unsigned int cx, cy, cw, ch; uint32_t cx, cy, cw, ch;
unsigned int dx; uint32_t dx;
unsigned int cols, rows, overcols; uint32_t cols, rows, overcols;
Client *c = NULL; Client *c = NULL;
n = 0; n = 0;
int target_gappo = enablegaps ? m->isoverview ? overviewgappo : gappoh : 0; int target_gappo = enablegaps ? m->isoverview ? overviewgappo : gappoh : 0;
@@ -121,15 +121,15 @@ void grid(Monitor *m) {
} }
void deck(Monitor *m) { void deck(Monitor *m) {
unsigned int mw, my; uint32_t mw, my;
int i, n = 0; int i, n = 0;
Client *c = NULL; Client *c = NULL;
Client *fc = NULL; Client *fc = NULL;
float mfact; float mfact;
unsigned int cur_gappih = enablegaps ? m->gappih : 0; uint32_t cur_gappih = enablegaps ? m->gappih : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
cur_gappih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappih; cur_gappih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappih;
cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh; cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh;
@@ -192,9 +192,9 @@ void deck(Monitor *m) {
void horizontal_scroll_adjust_fullandmax(Client *c, void horizontal_scroll_adjust_fullandmax(Client *c,
struct wlr_box *target_geom) { struct wlr_box *target_geom) {
Monitor *m = c->mon; Monitor *m = c->mon;
unsigned int cur_gappih = enablegaps ? m->gappih : 0; uint32_t cur_gappih = enablegaps ? m->gappih : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
cur_gappih = cur_gappih =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappih; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappih;
@@ -223,7 +223,7 @@ void horizontal_scroll_adjust_fullandmax(Client *c,
// 滚动布局 // 滚动布局
void scroller(Monitor *m) { void scroller(Monitor *m) {
unsigned int i, n, j; uint32_t i, n, j;
float single_proportion = 1.0; float single_proportion = 1.0;
Client *c = NULL, *root_client = NULL; Client *c = NULL, *root_client = NULL;
@@ -231,9 +231,9 @@ void scroller(Monitor *m) {
struct wlr_box target_geom; struct wlr_box target_geom;
int focus_client_index = 0; int focus_client_index = 0;
bool need_scroller = false; bool need_scroller = false;
unsigned int cur_gappih = enablegaps ? m->gappih : 0; uint32_t cur_gappih = enablegaps ? m->gappih : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
cur_gappih = cur_gappih =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappih; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappih;
@@ -242,8 +242,7 @@ void scroller(Monitor *m) {
cur_gappov = cur_gappov =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappov; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappov;
unsigned int max_client_width = uint32_t max_client_width = m->w.width - 2 * scroller_structs - cur_gappih;
m->w.width - 2 * scroller_structs - cur_gappih;
n = m->visible_scroll_tiling_clients; n = m->visible_scroll_tiling_clients;
@@ -378,7 +377,7 @@ void scroller(Monitor *m) {
} }
void center_tile(Monitor *m) { void center_tile(Monitor *m) {
unsigned int i, n = 0, h, r, ie = enablegaps, mw, mx, my, oty, ety, tw; uint32_t i, n = 0, h, r, ie = enablegaps, mw, mx, my, oty, ety, tw;
Client *c = NULL; Client *c = NULL;
Client *fc = NULL; Client *fc = NULL;
double mfact = 0; double mfact = 0;
@@ -399,10 +398,10 @@ void center_tile(Monitor *m) {
} }
// 间隙参数处理 // 间隙参数处理
unsigned int cur_gappiv = enablegaps ? m->gappiv : 0; // 内部垂直间隙 uint32_t cur_gappiv = enablegaps ? m->gappiv : 0; // 内部垂直间隙
unsigned int cur_gappih = enablegaps ? m->gappih : 0; // 内部水平间隙 uint32_t cur_gappih = enablegaps ? m->gappih : 0; // 内部水平间隙
unsigned int cur_gappov = enablegaps ? m->gappov : 0; // 外部垂直间隙 uint32_t cur_gappov = enablegaps ? m->gappov : 0; // 外部垂直间隙
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; // 外部水平间隙 uint32_t cur_gappoh = enablegaps ? m->gappoh : 0; // 外部水平间隙
// 智能间隙处理 // 智能间隙处理
cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv; cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv;
@@ -410,7 +409,7 @@ void center_tile(Monitor *m) {
cur_gappov = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappov; cur_gappov = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappov;
cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh; cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh;
unsigned int nmasters = m->pertag->nmasters[m->pertag->curtag]; uint32_t nmasters = m->pertag->nmasters[m->pertag->curtag];
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];
@@ -489,7 +488,7 @@ void center_tile(Monitor *m) {
my += c->geom.height + cur_gappiv * ie; my += c->geom.height + cur_gappiv * ie;
} else { } else {
// 堆叠区域窗口 // 堆叠区域窗口
unsigned int stack_index = i - nmasters; uint32_t stack_index = i - nmasters;
if (n - nmasters == 1) { if (n - nmasters == 1) {
// 单个堆叠窗口 // 单个堆叠窗口
@@ -587,7 +586,7 @@ void center_tile(Monitor *m) {
} }
void tile(Monitor *m) { void tile(Monitor *m) {
unsigned int i, n = 0, h, r, ie = enablegaps, mw, my, ty; uint32_t i, n = 0, h, r, ie = enablegaps, mw, my, ty;
Client *c = NULL; Client *c = NULL;
Client *fc = NULL; Client *fc = NULL;
double mfact = 0; double mfact = 0;
@@ -601,10 +600,10 @@ void tile(Monitor *m) {
if (n == 0) if (n == 0)
return; return;
unsigned int cur_gappiv = enablegaps ? m->gappiv : 0; uint32_t cur_gappiv = enablegaps ? m->gappiv : 0;
unsigned int cur_gappih = enablegaps ? m->gappih : 0; uint32_t cur_gappih = enablegaps ? m->gappih : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv; cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv;
cur_gappih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappih; cur_gappih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappih;
@@ -684,7 +683,7 @@ void tile(Monitor *m) {
} }
void right_tile(Monitor *m) { void right_tile(Monitor *m) {
unsigned int i, n = 0, h, r, ie = enablegaps, mw, my, ty; uint32_t i, n = 0, h, r, ie = enablegaps, mw, my, ty;
Client *c = NULL; Client *c = NULL;
Client *fc = NULL; Client *fc = NULL;
double mfact = 0; double mfact = 0;
@@ -698,10 +697,10 @@ void right_tile(Monitor *m) {
if (n == 0) if (n == 0)
return; return;
unsigned int cur_gappiv = enablegaps ? m->gappiv : 0; uint32_t cur_gappiv = enablegaps ? m->gappiv : 0;
unsigned int cur_gappih = enablegaps ? m->gappih : 0; uint32_t cur_gappih = enablegaps ? m->gappih : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv; cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv;
cur_gappih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappih; cur_gappih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappih;
@@ -786,8 +785,8 @@ monocle(Monitor *m) {
Client *c = NULL; Client *c = NULL;
struct wlr_box geom; struct wlr_box geom;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh; cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh;
cur_gappov = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappov; cur_gappov = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappov;

View File

@@ -1,5 +1,5 @@
void vertical_tile(Monitor *m) { void vertical_tile(Monitor *m) {
unsigned int i, n = 0, w, r, ie = enablegaps, mh, mx, tx; uint32_t i, n = 0, w, r, ie = enablegaps, mh, mx, tx;
Client *c = NULL; Client *c = NULL;
Client *fc = NULL; Client *fc = NULL;
double mfact = 0; double mfact = 0;
@@ -13,10 +13,10 @@ void vertical_tile(Monitor *m) {
if (n == 0) if (n == 0)
return; return;
unsigned int cur_gapih = enablegaps ? m->gappih : 0; uint32_t cur_gapih = enablegaps ? m->gappih : 0;
unsigned int cur_gapiv = enablegaps ? m->gappiv : 0; uint32_t cur_gapiv = enablegaps ? m->gappiv : 0;
unsigned int cur_gapoh = enablegaps ? m->gappoh : 0; uint32_t cur_gapoh = enablegaps ? m->gappoh : 0;
unsigned int cur_gapov = enablegaps ? m->gappov : 0; uint32_t cur_gapov = enablegaps ? m->gappov : 0;
cur_gapih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gapih; cur_gapih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gapih;
cur_gapiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gapiv; cur_gapiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gapiv;
@@ -92,15 +92,15 @@ void vertical_tile(Monitor *m) {
} }
void vertical_deck(Monitor *m) { void vertical_deck(Monitor *m) {
unsigned int mh, mx; uint32_t mh, mx;
int i, n = 0; int i, n = 0;
Client *c = NULL; Client *c = NULL;
Client *fc = NULL; Client *fc = NULL;
float mfact; float mfact;
unsigned int cur_gappiv = enablegaps ? m->gappiv : 0; uint32_t cur_gappiv = enablegaps ? m->gappiv : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv; cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv;
cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh; cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh;
@@ -157,9 +157,9 @@ void vertical_deck(Monitor *m) {
void vertical_scroll_adjust_fullandmax(Client *c, struct wlr_box *target_geom) { void vertical_scroll_adjust_fullandmax(Client *c, struct wlr_box *target_geom) {
Monitor *m = c->mon; Monitor *m = c->mon;
unsigned int cur_gappiv = enablegaps ? m->gappiv : 0; uint32_t cur_gappiv = enablegaps ? m->gappiv : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
cur_gappiv = cur_gappiv =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappiv; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappiv;
@@ -188,7 +188,7 @@ void vertical_scroll_adjust_fullandmax(Client *c, struct wlr_box *target_geom) {
// 竖屏滚动布局 // 竖屏滚动布局
void vertical_scroller(Monitor *m) { void vertical_scroller(Monitor *m) {
unsigned int i, n, j; uint32_t i, n, j;
float single_proportion = 1.0; float single_proportion = 1.0;
Client *c = NULL, *root_client = NULL; Client *c = NULL, *root_client = NULL;
@@ -196,9 +196,9 @@ void vertical_scroller(Monitor *m) {
struct wlr_box target_geom; struct wlr_box target_geom;
int focus_client_index = 0; int focus_client_index = 0;
bool need_scroller = false; bool need_scroller = false;
unsigned int cur_gappiv = enablegaps ? m->gappiv : 0; uint32_t cur_gappiv = enablegaps ? m->gappiv : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; uint32_t cur_gappov = enablegaps ? m->gappov : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; uint32_t cur_gappoh = enablegaps ? m->gappoh : 0;
cur_gappiv = cur_gappiv =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappiv; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappiv;
@@ -207,7 +207,7 @@ void vertical_scroller(Monitor *m) {
cur_gappoh = cur_gappoh =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappoh; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappoh;
unsigned int max_client_height = uint32_t max_client_height =
m->w.height - 2 * scroller_structs - cur_gappiv; m->w.height - 2 * scroller_structs - cur_gappiv;
n = m->visible_scroll_tiling_clients; n = m->visible_scroll_tiling_clients;
@@ -341,10 +341,10 @@ void vertical_scroller(Monitor *m) {
} }
void vertical_grid(Monitor *m) { void vertical_grid(Monitor *m) {
unsigned int i, n; uint32_t i, n;
unsigned int cx, cy, cw, ch; uint32_t cx, cy, cw, ch;
unsigned int dy; uint32_t dy;
unsigned int rows, cols, overrows; uint32_t rows, cols, overrows;
Client *c = NULL; Client *c = NULL;
int target_gappo = enablegaps ? m->isoverview ? overviewgappo : gappov : 0; int target_gappo = enablegaps ? m->isoverview ? overviewgappo : gappov : 0;
int target_gappi = enablegaps ? m->isoverview ? overviewgappi : gappiv : 0; int target_gappi = enablegaps ? m->isoverview ? overviewgappi : gappiv : 0;

View File

@@ -223,16 +223,16 @@ typedef struct {
char *v; char *v;
char *v2; char *v2;
char *v3; char *v3;
unsigned int ui; uint32_t ui;
unsigned int ui2; uint32_t ui2;
} Arg; } Arg;
struct mango_print_status_manager { struct mango_print_status_manager {
struct wl_signal print_status; struct wl_signal print_status;
}; };
typedef struct { typedef struct {
unsigned int mod; uint32_t mod;
unsigned int button; uint32_t button;
int (*func)(const Arg *); int (*func)(const Arg *);
const Arg arg; const Arg arg;
} Button; // 鼠标按键 } Button; // 鼠标按键
@@ -243,8 +243,8 @@ typedef struct {
} KeyMode; } KeyMode;
typedef struct { typedef struct {
unsigned int mod; uint32_t mod;
unsigned int dir; uint32_t dir;
int (*func)(const Arg *); int (*func)(const Arg *);
const Arg arg; const Arg arg;
} Axis; } Axis;
@@ -272,8 +272,8 @@ struct dwl_animation {
bool tagouting; bool tagouting;
bool begin_fade_in; bool begin_fade_in;
bool tag_from_rule; bool tag_from_rule;
unsigned int time_started; uint32_t time_started;
unsigned int duration; uint32_t duration;
struct wlr_box initial; struct wlr_box initial;
struct wlr_box current; struct wlr_box current;
int action; int action;
@@ -284,8 +284,8 @@ struct dwl_opacity_animation {
float current_opacity; float current_opacity;
float target_opacity; float target_opacity;
float initial_opacity; float initial_opacity;
unsigned int time_started; uint32_t time_started;
unsigned int duration; uint32_t duration;
float current_border_color[4]; float current_border_color[4];
float target_border_color[4]; float target_border_color[4];
float initial_border_color[4]; float initial_border_color[4];
@@ -302,7 +302,7 @@ typedef struct {
struct Client { struct Client {
/* Must keep these three elements in this order */ /* Must keep these three elements in this order */
unsigned int type; /* XDGShell or X11* */ uint32_t type; /* XDGShell or X11* */
struct wlr_box geom, pending, float_geom, animainit_geom, struct wlr_box geom, pending, float_geom, animainit_geom,
overview_backup_geom, current, overview_backup_geom, current,
drag_begin_geom; /* layout-relative, includes border */ drag_begin_geom; /* layout-relative, includes border */
@@ -334,10 +334,10 @@ struct Client {
struct wl_listener set_hints; struct wl_listener set_hints;
struct wl_listener set_geometry; struct wl_listener set_geometry;
#endif #endif
unsigned int bw; uint32_t bw;
unsigned int tags, oldtags, mini_restore_tag; uint32_t tags, oldtags, mini_restore_tag;
bool dirty; bool dirty;
unsigned int configure_serial; uint32_t configure_serial;
struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel; struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel;
int isfloating, isurgent, isfullscreen, isfakefullscreen, int isfloating, isurgent, isfullscreen, isfakefullscreen,
need_float_size_reduce, isminimized, isoverlay, isnosizehint, need_float_size_reduce, isminimized, isoverlay, isnosizehint,
@@ -414,7 +414,7 @@ typedef struct {
} DwlIpcOutput; } DwlIpcOutput;
typedef struct { typedef struct {
unsigned int mod; uint32_t mod;
xkb_keysym_t keysym; xkb_keysym_t keysym;
int (*func)(const Arg *); int (*func)(const Arg *);
const Arg arg; const Arg arg;
@@ -425,8 +425,8 @@ typedef struct {
int nsyms; int nsyms;
const xkb_keysym_t *keysyms; /* invalid if nsyms == 0 */ const xkb_keysym_t *keysyms; /* invalid if nsyms == 0 */
unsigned int mods; /* invalid if nsyms == 0 */ uint32_t mods; /* invalid if nsyms == 0 */
unsigned int keycode; uint32_t keycode;
struct wl_event_source *key_repeat_source; struct wl_event_source *key_repeat_source;
struct wl_listener modifiers; struct wl_listener modifiers;
@@ -442,7 +442,7 @@ typedef struct {
typedef struct { typedef struct {
/* Must keep these three elements in this order */ /* Must keep these three elements in this order */
unsigned int type; /* LayerShell */ uint32_t type; /* LayerShell */
struct wlr_box geom, current, pending, animainit_geom; struct wlr_box geom, current, pending, animainit_geom;
Monitor *mon; Monitor *mon;
struct wlr_scene_tree *scene; struct wlr_scene_tree *scene;
@@ -473,7 +473,7 @@ typedef struct {
const char *symbol; const char *symbol;
void (*arrange)(Monitor *); void (*arrange)(Monitor *);
const char *name; const char *name;
unsigned int id; uint32_t id;
} Layout; } Layout;
struct Monitor { struct Monitor {
@@ -490,8 +490,8 @@ struct Monitor {
struct wlr_box w; /* window area, layout-relative */ struct wlr_box w; /* window area, layout-relative */
struct wl_list layers[4]; /* LayerSurface::link */ struct wl_list layers[4]; /* LayerSurface::link */
const Layout *lt; const Layout *lt;
unsigned int seltags; uint32_t seltags;
unsigned int tagset[2]; uint32_t tagset[2];
double mfact; double mfact;
int nmaster; int nmaster;
@@ -505,9 +505,9 @@ struct Monitor {
int isoverview; int isoverview;
int is_in_hotarea; int is_in_hotarea;
int asleep; int asleep;
unsigned int visible_clients; uint32_t visible_clients;
unsigned int visible_tiling_clients; uint32_t visible_tiling_clients;
unsigned int visible_scroll_tiling_clients; uint32_t visible_scroll_tiling_clients;
bool has_visible_fullscreen_client; bool has_visible_fullscreen_client;
struct wlr_scene_optimized_blur *blur; struct wlr_scene_optimized_blur *blur;
char last_surface_ws_name[256]; char last_surface_ws_name[256];
@@ -539,7 +539,7 @@ arrange(Monitor *m,
static void arrangelayer(Monitor *m, struct wl_list *list, static void arrangelayer(Monitor *m, struct wl_list *list,
struct wlr_box *usable_area, int exclusive); struct wlr_box *usable_area, int exclusive);
static void arrangelayers(Monitor *m); static void arrangelayers(Monitor *m);
static char *get_autostart_path(char *, unsigned int); // 自启动命令执行 static char *get_autostart_path(char *, uint32_t); // 自启动命令执行
static void handle_print_status(struct wl_listener *listener, void *data); static void handle_print_status(struct wl_listener *listener, void *data);
static void axisnotify(struct wl_listener *listener, static void axisnotify(struct wl_listener *listener,
void *data); // 滚轮事件处理 void *data); // 滚轮事件处理
@@ -605,21 +605,20 @@ static void gpureset(struct wl_listener *listener, void *data);
static int keyrepeat(void *data); static int keyrepeat(void *data);
static void inputdevice(struct wl_listener *listener, void *data); static void inputdevice(struct wl_listener *listener, void *data);
static int keybinding(unsigned int state, bool locked, unsigned int mods, static int keybinding(uint32_t state, bool locked, uint32_t mods,
xkb_keysym_t sym, unsigned int keycode); xkb_keysym_t sym, uint32_t keycode);
static void keypress(struct wl_listener *listener, void *data); static void keypress(struct wl_listener *listener, void *data);
static void keypressmod(struct wl_listener *listener, void *data); static void keypressmod(struct wl_listener *listener, void *data);
static bool keypressglobal(struct wlr_surface *last_surface, static bool keypressglobal(struct wlr_surface *last_surface,
struct wlr_keyboard *keyboard, struct wlr_keyboard *keyboard,
struct wlr_keyboard_key_event *event, struct wlr_keyboard_key_event *event, uint32_t mods,
unsigned int mods, xkb_keysym_t keysym, xkb_keysym_t keysym, uint32_t keycode);
unsigned int keycode);
static void locksession(struct wl_listener *listener, void *data); static void locksession(struct wl_listener *listener, void *data);
static void mapnotify(struct wl_listener *listener, void *data); static void mapnotify(struct wl_listener *listener, void *data);
static void maximizenotify(struct wl_listener *listener, void *data); static void maximizenotify(struct wl_listener *listener, void *data);
static void minimizenotify(struct wl_listener *listener, void *data); static void minimizenotify(struct wl_listener *listener, void *data);
static void motionabsolute(struct wl_listener *listener, void *data); static void motionabsolute(struct wl_listener *listener, void *data);
static void motionnotify(unsigned int time, struct wlr_input_device *device, static void motionnotify(uint32_t time, struct wlr_input_device *device,
double sx, double sy, double sx_unaccel, double sx, double sy, double sx_unaccel,
double sy_unaccel); double sy_unaccel);
static void motionrelative(struct wl_listener *listener, void *data); static void motionrelative(struct wl_listener *listener, void *data);
@@ -633,8 +632,8 @@ static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config,
int test); int test);
static void outputmgrtest(struct wl_listener *listener, void *data); static void outputmgrtest(struct wl_listener *listener, void *data);
static void pointerfocus(Client *c, struct wlr_surface *surface, double sx, static void pointerfocus(Client *c, struct wlr_surface *surface, double sx,
double sy, unsigned int time); double sy, uint32_t time);
static void printstatus(unsigned int event_mask); static void printstatus(uint32_t event_mask);
static void quitsignal(int signo); static void quitsignal(int signo);
static void powermgrsetmode(struct wl_listener *listener, void *data); static void powermgrsetmode(struct wl_listener *listener, void *data);
static void rendermon(struct wl_listener *listener, void *data); static void rendermon(struct wl_listener *listener, void *data);
@@ -651,7 +650,7 @@ static void setmaximizescreen(Client *c, int maximizescreen);
static void reset_maximizescreen_size(Client *c); static void reset_maximizescreen_size(Client *c);
static void setgaps(int oh, int ov, int ih, int iv); static void setgaps(int oh, int ov, int ih, int iv);
static void setmon(Client *c, Monitor *m, unsigned int newtags, bool focus); static void setmon(Client *c, Monitor *m, uint32_t newtags, bool focus);
static void setpsel(struct wl_listener *listener, void *data); static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data); static void setsel(struct wl_listener *listener, void *data);
static void setup(void); static void setup(void);
@@ -682,7 +681,7 @@ static Client *termforwin(Client *w);
static void swallow(Client *c, Client *w); static void swallow(Client *c, Client *w);
static void warp_cursor_to_selmon(Monitor *m); static void warp_cursor_to_selmon(Monitor *m);
unsigned int want_restore_fullscreen(Client *target_client); uint32_t want_restore_fullscreen(Client *target_client);
static void overview_restore(Client *c, const Arg *arg); static void overview_restore(Client *c, const Arg *arg);
static void overview_backup(Client *c); static void overview_backup(Client *c);
static int applyrulesgeom(Client *c); static int applyrulesgeom(Client *c);
@@ -695,7 +694,7 @@ static void tag_client(const Arg *arg, Client *target_client);
static struct wlr_box setclient_coordinate_center(Client *c, static struct wlr_box setclient_coordinate_center(Client *c,
struct wlr_box geom, struct wlr_box geom,
int offsetx, int offsety); int offsetx, int offsety);
static unsigned int get_tags_first_tag(unsigned int tags); static uint32_t get_tags_first_tag(uint32_t tags);
static struct wlr_output_mode * static struct wlr_output_mode *
get_nearest_output_mode(struct wlr_output *output, int width, int height, get_nearest_output_mode(struct wlr_output *output, int width, int height,
@@ -726,11 +725,11 @@ static bool check_hit_no_border(Client *c);
static void reset_keyboard_layout(void); static void reset_keyboard_layout(void);
static void client_update_oldmonname_record(Client *c, Monitor *m); static void client_update_oldmonname_record(Client *c, Monitor *m);
static void pending_kill_client(Client *c); static void pending_kill_client(Client *c);
static unsigned int get_tags_first_tag_num(unsigned int source_tags); static uint32_t get_tags_first_tag_num(uint32_t source_tags);
static void set_layer_open_animaiton(LayerSurface *l, struct wlr_box geo); static void set_layer_open_animaiton(LayerSurface *l, struct wlr_box geo);
static void init_fadeout_layers(LayerSurface *l); static void init_fadeout_layers(LayerSurface *l);
static void layer_actual_size(LayerSurface *l, unsigned int *width, static void layer_actual_size(LayerSurface *l, uint32_t *width,
unsigned int *height); uint32_t *height);
static void get_layer_target_geometry(LayerSurface *l, static void get_layer_target_geometry(LayerSurface *l,
struct wlr_box *target_box); struct wlr_box *target_box);
static void scene_buffer_apply_effect(struct wlr_scene_buffer *buffer, int sx, static void scene_buffer_apply_effect(struct wlr_scene_buffer *buffer, int sx,
@@ -752,13 +751,13 @@ static Client *get_client_by_id_or_title(const char *arg_id,
const char *arg_title); const char *arg_title);
static bool switch_scratchpad_client_state(Client *c); static bool switch_scratchpad_client_state(Client *c);
static bool check_trackpad_disabled(struct wlr_pointer *pointer); static bool check_trackpad_disabled(struct wlr_pointer *pointer);
static unsigned int get_tag_status(unsigned int tag, Monitor *m); static uint32_t get_tag_status(uint32_t 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); static void set_float_malposition(Client *tc);
static void set_size_per(Monitor *m, Client *c); static void set_size_per(Monitor *m, Client *c);
static void resize_tile_client(Client *grabc, bool isdrag, int offsetx, static void resize_tile_client(Client *grabc, bool isdrag, int offsetx,
int offsety, unsigned int time); int offsety, uint32_t time);
static void refresh_monitors_workspaces_status(Monitor *m); static void refresh_monitors_workspaces_status(Monitor *m);
static void init_client_properties(Client *c); static void init_client_properties(Client *c);
static float *get_border_color(Client *c); static float *get_border_color(Client *c);
@@ -773,7 +772,7 @@ static void clear_fullscreen_and_maximized_state(Monitor *m);
static const char broken[] = "broken"; static const char broken[] = "broken";
static pid_t child_pid = -1; static pid_t child_pid = -1;
static int locked; static int locked;
static unsigned int locked_mods = 0; static uint32_t locked_mods = 0;
static void *exclusive_focus; static void *exclusive_focus;
static struct wl_display *dpy; static struct wl_display *dpy;
static struct wl_event_loop *event_loop; static struct wl_event_loop *event_loop;
@@ -824,7 +823,7 @@ static struct wlr_seat *seat;
static KeyboardGroup *kb_group; static KeyboardGroup *kb_group;
static struct wl_list inputdevices; static struct wl_list inputdevices;
static struct wl_list keyboard_shortcut_inhibitors; static struct wl_list keyboard_shortcut_inhibitors;
static unsigned int cursor_mode; static uint32_t cursor_mode;
static Client *grabc; static Client *grabc;
static int grabcx, grabcy; /* client-relative */ static int grabcx, grabcy; /* client-relative */
static int drag_begin_cursorx, drag_begin_cursory; /* client-relative */ static int drag_begin_cursorx, drag_begin_cursory; /* client-relative */
@@ -841,7 +840,7 @@ static int axis_apply_time = 0;
static int axis_apply_dir = 0; static int axis_apply_dir = 0;
static int scroller_focus_lock = 0; static int scroller_focus_lock = 0;
static unsigned int swipe_fingers = 0; static uint32_t swipe_fingers = 0;
static double swipe_dx = 0; static double swipe_dx = 0;
static double swipe_dy = 0; static double swipe_dy = 0;
@@ -871,7 +870,7 @@ static struct {
#include "config/preset.h" #include "config/preset.h"
struct Pertag { struct Pertag {
unsigned int curtag, prevtag; /* current and previous tag */ uint32_t curtag, prevtag; /* current and previous tag */
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
bool no_hide[LENGTH(tags) + 1]; /* no_hide per tag */ bool no_hide[LENGTH(tags) + 1]; /* no_hide per tag */
@@ -1318,7 +1317,7 @@ void set_float_malposition(Client *tc) {
void applyrules(Client *c) { void applyrules(Client *c) {
/* rule matching */ /* rule matching */
const char *appid, *title; const char *appid, *title;
unsigned int i, newtags = 0; uint32_t i, newtags = 0;
const ConfigWinRule *r; const ConfigWinRule *r;
Monitor *m = NULL; Monitor *m = NULL;
Client *fc = NULL; Client *fc = NULL;
@@ -1493,9 +1492,9 @@ void apply_window_snap(Client *c) {
int snap_up_mon = 0, snap_down_mon = 0, snap_left_mon = 0, int snap_up_mon = 0, snap_down_mon = 0, snap_left_mon = 0,
snap_right_mon = 0; snap_right_mon = 0;
unsigned int cbw = !render_border || c->fake_no_border ? borderpx : 0; uint32_t cbw = !render_border || c->fake_no_border ? borderpx : 0;
unsigned int tcbw; uint32_t tcbw;
unsigned int cx, cy, cw, ch, tcx, tcy, tcw, tch; uint32_t cx, cy, cw, ch, tcx, tcy, tcw, tch;
cx = c->geom.x + cbw; cx = c->geom.x + cbw;
cy = c->geom.y + cbw; cy = c->geom.y + cbw;
cw = c->geom.width - 2 * cbw; cw = c->geom.width - 2 * cbw;
@@ -1595,7 +1594,7 @@ void focuslayer(LayerSurface *l) {
void reset_exclusive_layer(Monitor *m) { void reset_exclusive_layer(Monitor *m) {
LayerSurface *l = NULL; LayerSurface *l = NULL;
int i; int i;
unsigned int layers_above_shell[] = { uint32_t layers_above_shell[] = {
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY, ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
ZWLR_LAYER_SHELL_V1_LAYER_TOP, ZWLR_LAYER_SHELL_V1_LAYER_TOP,
ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM, ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM,
@@ -1660,10 +1659,10 @@ axisnotify(struct wl_listener *listener, void *data) {
* for example when you move the scroll wheel. */ * for example when you move the scroll wheel. */
struct wlr_pointer_axis_event *event = data; struct wlr_pointer_axis_event *event = data;
struct wlr_keyboard *keyboard, *hard_keyboard; struct wlr_keyboard *keyboard, *hard_keyboard;
unsigned int mods, hard_mods; uint32_t mods, hard_mods;
AxisBinding *a; AxisBinding *a;
int ji; int ji;
unsigned int adir; uint32_t adir;
// IDLE_NOTIFY_ACTIVITY; // IDLE_NOTIFY_ACTIVITY;
handlecursoractivity(); handlecursoractivity();
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat); wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
@@ -1717,11 +1716,11 @@ axisnotify(struct wl_listener *listener, void *data) {
int ongesture(struct wlr_pointer_swipe_end_event *event) { int ongesture(struct wlr_pointer_swipe_end_event *event) {
struct wlr_keyboard *keyboard, *hard_keyboard; struct wlr_keyboard *keyboard, *hard_keyboard;
unsigned int mods, hard_mods; uint32_t mods, hard_mods;
const GestureBinding *g; const GestureBinding *g;
unsigned int motion; uint32_t motion;
unsigned int adx = (int)round(fabs(swipe_dx)); uint32_t adx = (int)round(fabs(swipe_dx));
unsigned int ady = (int)round(fabs(swipe_dy)); uint32_t ady = (int)round(fabs(swipe_dy));
int handled = 0; int handled = 0;
int ji; int ji;
@@ -1886,7 +1885,7 @@ void // 鼠标按键事件
buttonpress(struct wl_listener *listener, void *data) { buttonpress(struct wl_listener *listener, void *data) {
struct wlr_pointer_button_event *event = data; struct wlr_pointer_button_event *event = data;
struct wlr_keyboard *hard_keyboard, *keyboard; struct wlr_keyboard *hard_keyboard, *keyboard;
unsigned int hard_mods, mods; uint32_t hard_mods, mods;
Client *c = NULL; Client *c = NULL;
LayerSurface *l = NULL; LayerSurface *l = NULL;
struct wlr_surface *surface; struct wlr_surface *surface;
@@ -2104,7 +2103,7 @@ void cleanup(void) {
void cleanupmon(struct wl_listener *listener, void *data) { void cleanupmon(struct wl_listener *listener, void *data) {
Monitor *m = wl_container_of(listener, m, destroy); Monitor *m = wl_container_of(listener, m, destroy);
LayerSurface *l = NULL, *tmp = NULL; LayerSurface *l = NULL, *tmp = NULL;
unsigned int i; uint32_t i;
/* m->layers[i] are intentionally not unlinked */ /* m->layers[i] are intentionally not unlinked */
for (i = 0; i < LENGTH(m->layers); i++) { for (i = 0; i < LENGTH(m->layers); i++) {
@@ -2518,14 +2517,14 @@ KeyboardGroup *createkeyboardgroup(void) {
xkb_mod_index_t mod_index = xkb_mod_index_t mod_index =
xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_NUM); xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_NUM);
if (mod_index != XKB_MOD_INVALID) if (mod_index != XKB_MOD_INVALID)
locked_mods |= (unsigned int)1 << mod_index; locked_mods |= (uint32_t)1 << mod_index;
} }
if (capslock) { if (capslock) {
xkb_mod_index_t mod_index = xkb_mod_index_t mod_index =
xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CAPS); xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CAPS);
if (mod_index != XKB_MOD_INVALID) if (mod_index != XKB_MOD_INVALID)
locked_mods |= (unsigned int)1 << mod_index; locked_mods |= (uint32_t)1 << mod_index;
} }
if (locked_mods) if (locked_mods)
@@ -2649,7 +2648,7 @@ void createmon(struct wl_listener *listener, void *data) {
* monitor) becomes available. */ * monitor) becomes available. */
struct wlr_output *wlr_output = data; struct wlr_output *wlr_output = data;
const ConfigMonitorRule *r; const ConfigMonitorRule *r;
unsigned int i; uint32_t i;
int ji, jk; int ji, jk;
struct wlr_output_state state; struct wlr_output_state state;
Monitor *m = NULL; Monitor *m = NULL;
@@ -3310,7 +3309,7 @@ void inputdevice(struct wl_listener *listener, void *data) {
/* This event is raised by the backend when a new input device becomes /* This event is raised by the backend when a new input device becomes
* available. */ * available. */
struct wlr_input_device *device = data; struct wlr_input_device *device = data;
unsigned int caps; uint32_t caps;
switch (device->type) { switch (device->type) {
case WLR_INPUT_DEVICE_KEYBOARD: case WLR_INPUT_DEVICE_KEYBOARD:
@@ -3367,8 +3366,8 @@ bool is_keyboard_shortcut_inhibitor(struct wlr_surface *surface) {
} }
int // 17 int // 17
keybinding(unsigned int state, bool locked, unsigned int mods, xkb_keysym_t sym, keybinding(uint32_t state, bool locked, uint32_t mods, xkb_keysym_t sym,
unsigned int keycode) { uint32_t keycode) {
/* /*
* Here we handle compositor keybindings. This is when the compositor is * Here we handle compositor keybindings. This is when the compositor is
* processing keys, rather than passing them on to the client for its * processing keys, rather than passing them on to the client for its
@@ -3432,10 +3431,10 @@ keybinding(unsigned int state, bool locked, unsigned int mods, xkb_keysym_t sym,
bool keypressglobal(struct wlr_surface *last_surface, bool keypressglobal(struct wlr_surface *last_surface,
struct wlr_keyboard *keyboard, struct wlr_keyboard *keyboard,
struct wlr_keyboard_key_event *event, unsigned int mods, struct wlr_keyboard_key_event *event, uint32_t mods,
xkb_keysym_t keysym, unsigned int keycode) { xkb_keysym_t keysym, uint32_t keycode) {
Client *c = NULL, *lastc = focustop(selmon); Client *c = NULL, *lastc = focustop(selmon);
unsigned int keycodes[32] = {0}; uint32_t keycodes[32] = {0};
int reset = false; int reset = false;
const char *appid = NULL; const char *appid = NULL;
const char *title = NULL; const char *title = NULL;
@@ -3511,14 +3510,14 @@ void keypress(struct wl_listener *listener, void *data) {
#endif #endif
/* Translate libinput keycode -> xkbcommon */ /* Translate libinput keycode -> xkbcommon */
unsigned int keycode = event->keycode + 8; uint32_t keycode = event->keycode + 8;
/* Get a list of keysyms based on the keymap for this keyboard */ /* Get a list of keysyms based on the keymap for this keyboard */
const xkb_keysym_t *syms; const xkb_keysym_t *syms;
int nsyms = xkb_state_key_get_syms(group->wlr_group->keyboard.xkb_state, int nsyms = xkb_state_key_get_syms(group->wlr_group->keyboard.xkb_state,
keycode, &syms); keycode, &syms);
int handled = 0; int handled = 0;
unsigned int mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard); uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat); wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
@@ -3915,7 +3914,7 @@ void motionabsolute(struct wl_listener *listener, void *data) {
motionnotify(event->time_msec, &event->pointer->base, dx, dy, dx, dy); motionnotify(event->time_msec, &event->pointer->base, dx, dy, dx, dy);
} }
void motionnotify(unsigned int time, struct wlr_input_device *device, double dx, void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
double dy, double dx_unaccel, double dy_unaccel) { double dy, double dx_unaccel, double dy_unaccel) {
double sx = 0, sy = 0, sx_confined, sy_confined; double sx = 0, sy = 0, sx_confined, sy_confined;
Client *c = NULL, *w = NULL; Client *c = NULL, *w = NULL;
@@ -4140,7 +4139,7 @@ void outputmgrtest(struct wl_listener *listener, void *data) {
} }
void pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy, void pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
unsigned int time) { uint32_t time) {
struct timespec now; struct timespec now;
if (surface != seat->pointer_state.focused_surface && sloppyfocus && time && if (surface != seat->pointer_state.focused_surface && sloppyfocus && time &&
@@ -4166,7 +4165,7 @@ void pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
} }
// 修改printstatus函数接受掩码参数 // 修改printstatus函数接受掩码参数
void printstatus(unsigned int event_mask) { void printstatus(uint32_t event_mask) {
wl_signal_emit(&print_status_manager->print_status, wl_signal_emit(&print_status_manager->print_status,
(void *)(uintptr_t)event_mask); (void *)(uintptr_t)event_mask);
} }
@@ -4310,7 +4309,7 @@ void setborder_color(Client *c) {
void exchange_two_client(Client *c1, Client *c2) { void exchange_two_client(Client *c1, Client *c2) {
Monitor *tmp_mon = NULL; Monitor *tmp_mon = NULL;
unsigned int tmp_tags; uint32_t tmp_tags;
double master_inner_per = 0.0f; double master_inner_per = 0.0f;
double master_mfact_per = 0.0f; double master_mfact_per = 0.0f;
double stack_innder_per = 0.0f; double stack_innder_per = 0.0f;
@@ -4747,9 +4746,9 @@ void reset_keyboard_layout(void) {
} }
// Apply the new keymap // Apply the new keymap
unsigned int depressed = keyboard->modifiers.depressed; uint32_t depressed = keyboard->modifiers.depressed;
unsigned int latched = keyboard->modifiers.latched; uint32_t latched = keyboard->modifiers.latched;
unsigned int locked = keyboard->modifiers.locked; uint32_t locked = keyboard->modifiers.locked;
wlr_keyboard_set_keymap(keyboard, new_keymap); wlr_keyboard_set_keymap(keyboard, new_keymap);
@@ -4784,7 +4783,7 @@ cleanup_context:
xkb_context_unref(context); xkb_context_unref(context);
} }
void setmon(Client *c, Monitor *m, unsigned int newtags, bool focus) { void setmon(Client *c, Monitor *m, uint32_t newtags, bool focus) {
Monitor *oldmon = c->mon; Monitor *oldmon = c->mon;
if (oldmon == m) if (oldmon == m)
@@ -4854,7 +4853,7 @@ void setsel(struct wl_listener *listener, void *data) {
} }
void show_hide_client(Client *c) { void show_hide_client(Client *c) {
unsigned int target = 1; uint32_t target = 1;
set_size_per(c->mon, c); set_size_per(c->mon, c);
target = get_tags_first_tag(c->oldtags); target = get_tags_first_tag(c->oldtags);
@@ -5269,7 +5268,7 @@ void tag_client(const Arg *arg, Client *target_client) {
void overview(Monitor *m) { grid(m); } void overview(Monitor *m) { grid(m); }
// 目标窗口有其他窗口和它同个tag就返回0 // 目标窗口有其他窗口和它同个tag就返回0
unsigned int want_restore_fullscreen(Client *target_client) { uint32_t want_restore_fullscreen(Client *target_client) {
Client *c = NULL; Client *c = NULL;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (c && c != target_client && c->tags == target_client->tags && if (c && c != target_client && c->tags == target_client->tags &&
@@ -5645,7 +5644,7 @@ urgent(struct wl_listener *listener, void *data) {
void view_in_mon(const Arg *arg, bool want_animation, Monitor *m, void view_in_mon(const Arg *arg, bool want_animation, Monitor *m,
bool changefocus) { bool changefocus) {
unsigned int i, tmptag; uint32_t i, tmptag;
if (!m || (arg->ui != (~0 & TAGMASK) && m->isoverview)) { if (!m || (arg->ui != (~0 & TAGMASK) && m->isoverview)) {
return; return;