opt: set all monitor pointer init value to NULL
This commit is contained in:
@@ -78,7 +78,7 @@ double find_animation_curve_at(double t, int type) {
|
|||||||
|
|
||||||
double all_output_frame_duration_ms() {
|
double all_output_frame_duration_ms() {
|
||||||
int32_t refresh_total = 0;
|
int32_t refresh_total = 0;
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
if (!m->wlr_output->enabled) {
|
if (!m->wlr_output->enabled) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -2770,7 +2770,7 @@ void parse_config(void) {
|
|||||||
|
|
||||||
void reset_blur_params(void) {
|
void reset_blur_params(void) {
|
||||||
if (blur) {
|
if (blur) {
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
if (m->blur != NULL) {
|
if (m->blur != NULL) {
|
||||||
wlr_scene_node_destroy(&m->blur->node);
|
wlr_scene_node_destroy(&m->blur->node);
|
||||||
@@ -2784,7 +2784,7 @@ void reset_blur_params(void) {
|
|||||||
blur_params.saturation);
|
blur_params.saturation);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
|
|
||||||
if (m->blur) {
|
if (m->blur) {
|
||||||
@@ -2797,7 +2797,7 @@ void reset_blur_params(void) {
|
|||||||
|
|
||||||
void reapply_monitor_rules(void) {
|
void reapply_monitor_rules(void) {
|
||||||
ConfigMonitorRule *mr;
|
ConfigMonitorRule *mr;
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
int ji, jk;
|
int ji, jk;
|
||||||
struct wlr_output_state state;
|
struct wlr_output_state state;
|
||||||
struct wlr_output_mode *internal_mode = NULL;
|
struct wlr_output_mode *internal_mode = NULL;
|
||||||
@@ -2897,7 +2897,7 @@ void reapply_pointer(void) {
|
|||||||
void reapply_master(void) {
|
void reapply_master(void) {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
for (i = 0; i <= LENGTH(tags); i++) {
|
for (i = 0; i <= LENGTH(tags); i++) {
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
if (!m->wlr_output->enabled) {
|
if (!m->wlr_output->enabled) {
|
||||||
@@ -2915,7 +2915,7 @@ void reapply_master(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void reapply_tagrule(void) {
|
void reapply_tagrule(void) {
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
int i, jk;
|
int i, jk;
|
||||||
char *rule_monitor_name = NULL;
|
char *rule_monitor_name = NULL;
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ void dwl_ipc_output_set_client_tags(struct wl_client *client,
|
|||||||
unsigned int and_tags,
|
unsigned int and_tags,
|
||||||
unsigned int xor_tags) {
|
unsigned int xor_tags) {
|
||||||
DwlIpcOutput *ipc_output;
|
DwlIpcOutput *ipc_output;
|
||||||
Monitor *monitor;
|
Monitor *monitor = NULL;
|
||||||
Client *selected_client = NULL;
|
Client *selected_client = NULL;
|
||||||
unsigned int newtags = 0;
|
unsigned int newtags = 0;
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ void dwl_ipc_output_set_layout(struct wl_client *client,
|
|||||||
struct wl_resource *resource,
|
struct wl_resource *resource,
|
||||||
unsigned int index) {
|
unsigned int index) {
|
||||||
DwlIpcOutput *ipc_output;
|
DwlIpcOutput *ipc_output;
|
||||||
Monitor *monitor;
|
Monitor *monitor = NULL;
|
||||||
|
|
||||||
ipc_output = wl_resource_get_user_data(resource);
|
ipc_output = wl_resource_get_user_data(resource);
|
||||||
if (!ipc_output)
|
if (!ipc_output)
|
||||||
@@ -254,7 +254,7 @@ void dwl_ipc_output_set_tags(struct wl_client *client,
|
|||||||
struct wl_resource *resource, unsigned int tagmask,
|
struct wl_resource *resource, unsigned int tagmask,
|
||||||
unsigned int toggle_tagset) {
|
unsigned int toggle_tagset) {
|
||||||
DwlIpcOutput *ipc_output;
|
DwlIpcOutput *ipc_output;
|
||||||
Monitor *monitor;
|
Monitor *monitor = NULL;
|
||||||
unsigned int newtags = tagmask & TAGMASK;
|
unsigned int newtags = tagmask & TAGMASK;
|
||||||
|
|
||||||
ipc_output = wl_resource_get_user_data(resource);
|
ipc_output = wl_resource_get_user_data(resource);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ void dwl_im_relay_set_focus(struct dwl_input_method_relay *relay,
|
|||||||
|
|
||||||
/*------------------协议内部代码------------------------------*/
|
/*------------------协议内部代码------------------------------*/
|
||||||
Monitor *output_from_wlr_output(struct wlr_output *wlr_output) {
|
Monitor *output_from_wlr_output(struct wlr_output *wlr_output) {
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
if (m->wlr_output == wlr_output) {
|
if (m->wlr_output == wlr_output) {
|
||||||
return m;
|
return m;
|
||||||
@@ -222,7 +222,7 @@ static void update_popup_position(struct dwl_input_method_popup *popup) {
|
|||||||
struct wlr_xdg_surface *xdg_surface;
|
struct wlr_xdg_surface *xdg_surface;
|
||||||
struct wlr_layer_surface_v1 *layer_surface;
|
struct wlr_layer_surface_v1 *layer_surface;
|
||||||
struct wlr_scene_tree *tree;
|
struct wlr_scene_tree *tree;
|
||||||
Monitor *output;
|
Monitor *output = NULL;
|
||||||
struct wlr_xdg_positioner_rules pointer_rules;
|
struct wlr_xdg_positioner_rules pointer_rules;
|
||||||
struct wlr_box output_box;
|
struct wlr_box output_box;
|
||||||
int lx, ly;
|
int lx, ly;
|
||||||
|
|||||||
14
src/mango.c
14
src/mango.c
@@ -1054,7 +1054,7 @@ void apply_named_scratchpad(Client *target_client) {
|
|||||||
void gpureset(struct wl_listener *listener, void *data) {
|
void gpureset(struct wl_listener *listener, void *data) {
|
||||||
struct wlr_renderer *old_drw = drw;
|
struct wlr_renderer *old_drw = drw;
|
||||||
struct wlr_allocator *old_alloc = alloc;
|
struct wlr_allocator *old_alloc = alloc;
|
||||||
struct Monitor *m;
|
struct Monitor *m = NULL;
|
||||||
|
|
||||||
wlr_log(WLR_DEBUG, "gpu reset");
|
wlr_log(WLR_DEBUG, "gpu reset");
|
||||||
|
|
||||||
@@ -1226,7 +1226,7 @@ void applyrules(Client *c) {
|
|||||||
const char *appid, *title;
|
const char *appid, *title;
|
||||||
unsigned int i, newtags = 0;
|
unsigned int i, newtags = 0;
|
||||||
const ConfigWinRule *r;
|
const ConfigWinRule *r;
|
||||||
Monitor *mon = selmon, *m;
|
Monitor *mon = selmon, *m = NULL;
|
||||||
Client *fc = NULL;
|
Client *fc = NULL;
|
||||||
bool hit_rule_pos = false;
|
bool hit_rule_pos = false;
|
||||||
|
|
||||||
@@ -2558,7 +2558,7 @@ void createmon(struct wl_listener *listener, void *data) {
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
int ji, jk;
|
int ji, jk;
|
||||||
struct wlr_output_state state;
|
struct wlr_output_state state;
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
struct wlr_output_mode *internal_mode = NULL;
|
struct wlr_output_mode *internal_mode = NULL;
|
||||||
bool custom_monitor_mode = false;
|
bool custom_monitor_mode = false;
|
||||||
|
|
||||||
@@ -4161,7 +4161,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;
|
Monitor *tmp_mon = NULL;
|
||||||
unsigned int tmp_tags;
|
unsigned int tmp_tags;
|
||||||
|
|
||||||
if (c1 == NULL || c2 == NULL ||
|
if (c1 == NULL || c2 == NULL ||
|
||||||
@@ -5195,7 +5195,7 @@ void unmapnotify(struct wl_listener *listener, void *data) {
|
|||||||
/* Called when the surface is unmapped, and should no longer be shown.
|
/* Called when the surface is unmapped, and should no longer be shown.
|
||||||
*/
|
*/
|
||||||
Client *c = wl_container_of(listener, c, unmap);
|
Client *c = wl_container_of(listener, c, unmap);
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
c->iskilling = 1;
|
c->iskilling = 1;
|
||||||
|
|
||||||
if (animations && !c->is_clip_to_hide && !c->isminied &&
|
if (animations && !c->is_clip_to_hide && !c->isminied &&
|
||||||
@@ -5289,7 +5289,7 @@ void updatemons(struct wl_listener *listener, void *data) {
|
|||||||
wlr_output_configuration_v1_create();
|
wlr_output_configuration_v1_create();
|
||||||
Client *c = NULL;
|
Client *c = NULL;
|
||||||
struct wlr_output_configuration_head_v1 *config_head;
|
struct wlr_output_configuration_head_v1 *config_head;
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
int mon_pos_offsetx, mon_pos_offsety, oldx, oldy;
|
int mon_pos_offsetx, mon_pos_offsety, oldx, oldy;
|
||||||
|
|
||||||
/* First remove from the layout the disabled monitors */
|
/* First remove from the layout the disabled monitors */
|
||||||
@@ -5505,7 +5505,7 @@ toggleseltags:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void view(const Arg *arg, bool want_animation) {
|
void view(const Arg *arg, bool want_animation) {
|
||||||
Monitor *m;
|
Monitor *m = NULL;
|
||||||
if (arg->i) {
|
if (arg->i) {
|
||||||
view_in_mon(arg, want_animation, selmon, true);
|
view_in_mon(arg, want_animation, selmon, true);
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
|
|||||||
Reference in New Issue
Block a user