Browse Source

menu: Add method to force redraw a visible menu

K. Lange 10 months ago
parent
commit
8c2cf93b1d
2 changed files with 7 additions and 0 deletions
  1. 1 0
      base/usr/include/toaru/menu.h
  2. 6 0
      lib/menu.c

+ 1 - 0
base/usr/include/toaru/menu.h

@@ -89,6 +89,7 @@ extern int menu_definitely_close(struct MenuList * menu);
 extern struct MenuSet * menu_set_create(void);
 extern void menu_set_insert(struct MenuSet * set, char * action, struct MenuList * menu);
 extern void menu_update_title(struct MenuEntry * self, char * new_title);
+extern void menu_force_redraw(struct MenuList * menu);
 
 #define MENU_BAR_HEIGHT 24
 

+ 6 - 0
lib/menu.c

@@ -784,6 +784,12 @@ void menu_mouse_action(struct MenuList * menu, struct yutani_msg_window_mouse_ev
 	}
 }
 
+void menu_force_redraw(struct MenuList * menu) {
+	yutani_window_t * window = menu->window;
+	yutani_t * yctx = window->ctx;
+	_menu_redraw(window,yctx,menu);
+}
+
 struct MenuList * menu_any_contains(int x, int y) {
 	struct MenuList * out = NULL;
 	list_t * menu_keys = hashmap_keys(menu_windows);