gboolean mouse_pointer_leave(int x, int y) { gboolean is_contain = FALSE; static Display* dpy = NULL; static Window dock_window = 0; if (dpy == NULL) { dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); dock_window = GDK_WINDOW_XID(DOCK_GDK_WINDOW()); } cairo_region_t* region = get_window_input_region(dpy, dock_window); is_contain = cairo_region_contains_point(region, x, y); cairo_region_destroy(region); return is_contain; }
// guide all event disable // desktop launcher all event enable // dock all event disable JS_EXPORT_API void guide_disable_guide_region() { //TODO: find the dock XID Window dock = get_dock_xid(); if(dock == 0){ g_warning("get_dock_xid error and return 0."); return; } Display* dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); cairo_region_t* dock_region = get_window_input_region(dpy, dock); //cairo_rectangle_int_t rectangle; //cairo_region_get_rectangle(dock_region,0,&rectangle); //int x0 = rectangle.x; //int y0 = rectangle.y; //int x1 = x0 + rectangle.width; //int y1 = y0 + rectangle.height; //g_message("dock_region:[%d,%d,%d,%d]",x0,y0,x1,y1); gdk_window_input_shape_combine_region(gtk_widget_get_window(get_container()), dock_region, 0, 0); cairo_region_destroy(dock_region); }