Add window resize indicator

This commit is contained in:
Consolatis 2023-08-17 18:59:29 +02:00
parent c8321e3264
commit 58b33fb0c9
12 changed files with 296 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include "common/buf.h"
#include "common/font.h"
#include "config/libinput.h"
#include "resize_indicator.h"
#include "theme.h"
enum window_switcher_field_content {
@ -78,6 +79,8 @@ struct rcxml {
int snap_edge_range;
bool snap_top_maximize;
enum resize_indicator_mode resize_indicator;
struct {
int popuptime;
int min_nr_workspaces;

View file

@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_RESIZE_INDICATOR_H
#define LABWC_RESIZE_INDICATOR_H
struct server;
struct view;
enum resize_indicator_mode {
LAB_RESIZE_INDICATOR_NEVER = 0,
LAB_RESIZE_INDICATOR_ALWAYS,
LAB_RESIZE_INDICATOR_NON_PIXEL
};
void resize_indicator_reconfigure(struct server *server);
void resize_indicator_show(struct view *view);
void resize_indicator_update(struct view *view);
void resize_indicator_hide(struct view *view);
#endif /* LABWC_RESIZE_INDICATOR_H */

View file

@ -128,6 +128,13 @@ struct view {
struct wl_event_source *pending_configure_timeout;
struct ssd *ssd;
struct resize_indicator {
int width, height;
struct wlr_scene_tree *tree;
struct wlr_scene_rect *border;
struct wlr_scene_rect *background;
struct scaled_font_buffer *text;
} resize_indicator;
struct foreign_toplevel {
struct wlr_foreign_toplevel_handle_v1 *handle;