分离修改窗口宽高/边框宽度和移动窗口操作
This commit is contained in:
@@ -190,6 +190,22 @@ void configure_window(xcb_window_t window, int32_t x, int32_t y, uint32_t width,
|
||||
xcb_aux_configure_window(conn, window, config_mask, &window_config);
|
||||
}
|
||||
|
||||
void move_window(xcb_window_t window, int32_t x, int32_t y) {
|
||||
xcb_config_window_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y;
|
||||
xcb_params_configure_window_t position = {.x = x, .y = y};
|
||||
xcb_aux_configure_window(conn, window, mask, &position);
|
||||
}
|
||||
|
||||
void resize_window(xcb_window_t window, uint32_t width, uint32_t height) {
|
||||
xcb_config_window_t config_mask =
|
||||
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
|
||||
xcb_params_configure_window_t window_config = {
|
||||
.width = width,
|
||||
.height = height,
|
||||
};
|
||||
xcb_aux_configure_window(conn, window, config_mask, &window_config);
|
||||
}
|
||||
|
||||
void change_window_cursor(xcb_window_t window, cursor_t cursor) {
|
||||
xcb_change_window_attributes_value_list_t value_list = {
|
||||
.cursor = get_xcb_cursor(cursor),
|
||||
@@ -285,6 +301,12 @@ void change_window_border_color(xcb_window_t window, uint32_t argb) {
|
||||
xcb_aux_change_window_attributes(conn, window, XCB_CW_BORDER_PIXEL, ¶ms);
|
||||
}
|
||||
|
||||
void change_window_border_width(xcb_window_t window, uint32_t border_width) {
|
||||
xcb_config_window_t config_mask = XCB_CONFIG_WINDOW_BORDER_WIDTH;
|
||||
xcb_params_configure_window_t window_config = {.border_width = border_width};
|
||||
xcb_aux_configure_window(conn, window, config_mask, &window_config);
|
||||
}
|
||||
|
||||
void focus_window(xcb_window_t window) {
|
||||
xcb_window_t root = screen->root;
|
||||
if (window == WINDOW_NONE) {
|
||||
@@ -316,7 +338,6 @@ void place_window_above_sibling(xcb_window_t window, xcb_window_t sibling) {
|
||||
xcb_aux_configure_window(conn, window, mask, ¶ms);
|
||||
}
|
||||
|
||||
|
||||
void place_window_below_sibling(xcb_window_t window, xcb_window_t sibling) {
|
||||
uint16_t mask = XCB_CONFIG_WINDOW_STACK_MODE | XCB_CONFIG_WINDOW_SIBLING;
|
||||
xcb_params_configure_window_t params = {
|
||||
|
||||
Reference in New Issue
Block a user