mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	implement handling for Client, Frame, and Root/Desktop (conflated for now) mouse contexts
This commit is contained in:
		
							parent
							
								
									4f6297d1ad
								
							
						
					
					
						commit
						b008917895
					
				
					 3 changed files with 18 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
#include "labwc.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Sequence these according to the order they should be processes for
 | 
			
		||||
 * Sequence these according to the order they should be processed for
 | 
			
		||||
 * press and hover events. Bear in mind that some of their respective
 | 
			
		||||
 * interactive areas overlap, so for example buttons need to come before title.
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			@ -24,6 +24,9 @@ enum ssd_part_type {
 | 
			
		|||
	LAB_SSD_PART_RIGHT,
 | 
			
		||||
	LAB_SSD_PART_BOTTOM,
 | 
			
		||||
	LAB_SSD_PART_LEFT,
 | 
			
		||||
	LAB_SSD_CLIENT,
 | 
			
		||||
	LAB_SSD_FRAME,
 | 
			
		||||
	LAB_SSD_ROOT,
 | 
			
		||||
	LAB_SSD_END_MARKER
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,6 +65,14 @@ context_from_str(const char *str)
 | 
			
		|||
		return LAB_SSD_BUTTON_MAXIMIZE;
 | 
			
		||||
	} else if (!strcasecmp(str, "Iconify")) {
 | 
			
		||||
		return LAB_SSD_BUTTON_ICONIFY;
 | 
			
		||||
	} else if (!strcasecmp(str, "Frame")) {
 | 
			
		||||
		return LAB_SSD_FRAME;
 | 
			
		||||
	} else if (!strcasecmp(str, "Client")) {
 | 
			
		||||
		return LAB_SSD_CLIENT;
 | 
			
		||||
	} else if (!strcasecmp(str, "Desktop")) {
 | 
			
		||||
		return LAB_SSD_ROOT;
 | 
			
		||||
	} else if (!strcasecmp(str, "Root")) {
 | 
			
		||||
		return LAB_SSD_ROOT;
 | 
			
		||||
	}
 | 
			
		||||
	wlr_log(WLR_ERROR, "unknown mouse context (%s)", str);
 | 
			
		||||
	return LAB_SSD_NONE;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -135,6 +135,12 @@ ssd_box(struct view *view, enum ssd_part_type type)
 | 
			
		|||
		box.width = theme->border_width + INVISIBLE_MARGIN;
 | 
			
		||||
		box.height = view->h;
 | 
			
		||||
		break;
 | 
			
		||||
	case LAB_SSD_CLIENT:
 | 
			
		||||
		box.x = view->x;
 | 
			
		||||
		box.y = view->y;
 | 
			
		||||
		box.width = view->w;
 | 
			
		||||
		box.height = view->h;
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue