Add input and bounding shapes support (#2742)
Basic idea: if the window has a shape, set the parent container shape as the union of the window shape and the shape of the frame borders. Co-authored-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
@ -484,6 +484,11 @@ struct Window {
|
||||
/* aspect ratio from WM_NORMAL_HINTS (MPlayer uses this for example) */
|
||||
double min_aspect_ratio;
|
||||
double max_aspect_ratio;
|
||||
|
||||
/** The window has a nonrectangular shape. */
|
||||
bool shaped;
|
||||
/** The window has a nonrectangular input shape. */
|
||||
bool input_shaped;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
extern int randr_base;
|
||||
extern int xkb_base;
|
||||
extern int shape_base;
|
||||
|
||||
/**
|
||||
* Adds the given sequence to the list of events which are ignored.
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <xcb/shape.h>
|
||||
#include <xcb/xcb_keysyms.h>
|
||||
#include <xcb/xkb.h>
|
||||
|
||||
@ -70,7 +71,7 @@ extern uint8_t root_depth;
|
||||
extern xcb_visualid_t visual_id;
|
||||
extern xcb_colormap_t colormap;
|
||||
|
||||
extern bool xcursor_supported, xkb_supported;
|
||||
extern bool xcursor_supported, xkb_supported, shape_supported;
|
||||
extern xcb_window_t root;
|
||||
extern struct ev_loop *main_loop;
|
||||
extern bool only_check_config;
|
||||
|
@ -137,3 +137,8 @@ void x_set_warp_to(Rect *rect);
|
||||
*
|
||||
*/
|
||||
void x_mask_event_mask(uint32_t mask);
|
||||
|
||||
/**
|
||||
* Enables or disables nonrectangular shape of the container frame.
|
||||
*/
|
||||
void x_set_shape(Con *con, xcb_shape_sk_t kind, bool enable);
|
||||
|
Reference in New Issue
Block a user