mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Fix coding style
This commit is contained in:
		
							parent
							
								
									104f635b43
								
							
						
					
					
						commit
						d2375b025d
					
				
					 3 changed files with 15 additions and 18 deletions
				
			
		| 
						 | 
					@ -18,10 +18,9 @@ mousebind_button_from_str(const char *str)
 | 
				
			||||||
		return BTN_RIGHT;
 | 
							return BTN_RIGHT;
 | 
				
			||||||
	} else if (!strcasecmp(str, "Middle")) {
 | 
						} else if (!strcasecmp(str, "Middle")) {
 | 
				
			||||||
		return BTN_MIDDLE;
 | 
							return BTN_MIDDLE;
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		wlr_log(WLR_ERROR, "unknown button (%s)", str);
 | 
					 | 
				
			||||||
		return UINT32_MAX;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						wlr_log(WLR_ERROR, "unknown button (%s)", str);
 | 
				
			||||||
 | 
						return UINT32_MAX;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum mouse_event
 | 
					enum mouse_event
 | 
				
			||||||
| 
						 | 
					@ -30,10 +29,9 @@ mousebind_event_from_str(const char *str)
 | 
				
			||||||
	assert(str);
 | 
						assert(str);
 | 
				
			||||||
	if (strcasecmp(str, "doubleclick") == 0) {
 | 
						if (strcasecmp(str, "doubleclick") == 0) {
 | 
				
			||||||
		return MOUSE_ACTION_DOUBLECLICK;
 | 
							return MOUSE_ACTION_DOUBLECLICK;
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		wlr_log(WLR_ERROR, "unknown mouse action (%s)", str);
 | 
					 | 
				
			||||||
		return MOUSE_ACTION_NONE;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						wlr_log(WLR_ERROR, "unknown mouse action (%s)", str);
 | 
				
			||||||
 | 
						return MOUSE_ACTION_NONE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static enum ssd_part_type
 | 
					static enum ssd_part_type
 | 
				
			||||||
| 
						 | 
					@ -41,10 +39,9 @@ context_from_str(const char *str)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (!strcasecmp(str, "Titlebar")) {
 | 
						if (!strcasecmp(str, "Titlebar")) {
 | 
				
			||||||
		return LAB_SSD_PART_TITLEBAR;
 | 
							return LAB_SSD_PART_TITLEBAR;
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		wlr_log(WLR_ERROR, "unknown mouse context (%s)", str);
 | 
					 | 
				
			||||||
		return LAB_SSD_NONE;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						wlr_log(WLR_ERROR, "unknown mouse context (%s)", str);
 | 
				
			||||||
 | 
						return LAB_SSD_NONE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mousebind *
 | 
					struct mousebind *
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,14 +21,13 @@
 | 
				
			||||||
#include "config/mousebind.h"
 | 
					#include "config/mousebind.h"
 | 
				
			||||||
#include "config/rcxml.h"
 | 
					#include "config/rcxml.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static bool in_keybind = false;
 | 
					static bool in_keybind;
 | 
				
			||||||
static bool in_mousebind = false;
 | 
					static bool in_mousebind;
 | 
				
			||||||
static struct keybind *current_keybind;
 | 
					static struct keybind *current_keybind;
 | 
				
			||||||
static struct mousebind *current_mousebind;
 | 
					static struct mousebind *current_mousebind;
 | 
				
			||||||
static const char *current_mouse_context;
 | 
					static const char *current_mouse_context;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum font_place
 | 
					enum font_place {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	FONT_PLACE_UNKNOWN = 0,
 | 
						FONT_PLACE_UNKNOWN = 0,
 | 
				
			||||||
	FONT_PLACE_ACTIVEWINDOW,
 | 
						FONT_PLACE_ACTIVEWINDOW,
 | 
				
			||||||
	FONT_PLACE_MENUITEM,
 | 
						FONT_PLACE_MENUITEM,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										11
									
								
								src/cursor.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/cursor.c
									
										
									
									
									
								
							| 
						 | 
					@ -351,13 +351,14 @@ cursor_button(struct wl_listener *listener, void *data)
 | 
				
			||||||
	desktop_focus_view(&server->seat, view);
 | 
						desktop_focus_view(&server->seat, view);
 | 
				
			||||||
	damage_all_outputs(server);
 | 
						damage_all_outputs(server);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (is_double_click(rc.doubleclick_time) && view_area == LAB_SSD_PART_TITLEBAR) {
 | 
						if (is_double_click(rc.doubleclick_time)
 | 
				
			||||||
		struct mousebind* mousebind;
 | 
								&& view_area == LAB_SSD_PART_TITLEBAR) {
 | 
				
			||||||
		wl_list_for_each_reverse(mousebind, &rc.mousebinds, link) {
 | 
							struct mousebind *mousebind;
 | 
				
			||||||
 | 
							wl_list_for_each_reverse (mousebind, &rc.mousebinds, link) {
 | 
				
			||||||
			/* TODO: make this more generic */
 | 
								/* TODO: make this more generic */
 | 
				
			||||||
			if( (mousebind->context == LAB_SSD_PART_TITLEBAR) &&
 | 
								if ((mousebind->context == LAB_SSD_PART_TITLEBAR) &&
 | 
				
			||||||
				(mousebind->mouse_event == MOUSE_ACTION_DOUBLECLICK) &&
 | 
									(mousebind->mouse_event == MOUSE_ACTION_DOUBLECLICK) &&
 | 
				
			||||||
				(mousebind->button == event->button) ) {
 | 
									(mousebind->button == event->button)) {
 | 
				
			||||||
				action(server, mousebind->action, mousebind->command);
 | 
									action(server, mousebind->action, mousebind->command);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue