mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
opt: new impl for gamma controller
This commit is contained in:
parent
0b9de30cb1
commit
16fa2cad95
1 changed files with 1 additions and 29 deletions
30
maomao.c
30
maomao.c
|
|
@ -348,7 +348,6 @@ struct Monitor {
|
|||
Client *sel, *prevsel;
|
||||
int isoverview;
|
||||
int is_in_hotarea;
|
||||
int gamma_lut_changed;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -522,7 +521,6 @@ static void setup(void);
|
|||
static void sigchld(int unused);
|
||||
static void startdrag(struct wl_listener *listener, void *data);
|
||||
|
||||
static void setgamma(struct wl_listener *listener, void *data);
|
||||
static void tile(Monitor *m, unsigned int gappo, unsigned int uappi);
|
||||
static void overview(Monitor *m, unsigned int gappo, unsigned int gappi);
|
||||
static void grid(Monitor *m, unsigned int gappo, unsigned int uappi);
|
||||
|
|
@ -620,7 +618,6 @@ static struct wlr_renderer *drw;
|
|||
static struct wlr_allocator *alloc;
|
||||
static struct wlr_compositor *compositor;
|
||||
|
||||
static struct wlr_gamma_control_manager_v1 *gamma_control_mgr;
|
||||
static struct wlr_xdg_shell *xdg_shell;
|
||||
static struct wlr_xdg_activation_v1 *activation;
|
||||
static struct wlr_xdg_decoration_manager_v1 *xdg_decoration_mgr;
|
||||
|
|
@ -1182,26 +1179,6 @@ void clear_fullscreen_flag(Client *c) {
|
|||
}
|
||||
}
|
||||
|
||||
void // 升级忽略
|
||||
setgamma(struct wl_listener *listener, void *data) {
|
||||
struct wlr_gamma_control_manager_v1_set_gamma_event *event = data;
|
||||
struct wlr_output_state state;
|
||||
wlr_output_state_init(&state);
|
||||
if (!wlr_gamma_control_v1_apply(event->control, &state)) {
|
||||
wlr_output_state_finish(&state);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wlr_output_test_state(event->output, &state)) {
|
||||
wlr_gamma_control_v1_send_failed_and_destroy(event->control);
|
||||
wlr_output_state_finish(&state);
|
||||
return;
|
||||
}
|
||||
|
||||
wlr_output_commit_state(event->output, &state);
|
||||
wlr_output_schedule_frame(event->output);
|
||||
}
|
||||
|
||||
void minized(const Arg *arg) {
|
||||
if (selmon->sel && !selmon->sel->isminied) {
|
||||
set_minized(selmon->sel);
|
||||
|
|
@ -5044,8 +5021,7 @@ void setup(void) {
|
|||
activation = wlr_xdg_activation_v1_create(dpy);
|
||||
wl_signal_add(&activation->events.request_activate, &request_activate);
|
||||
|
||||
gamma_control_mgr = wlr_gamma_control_manager_v1_create(dpy);
|
||||
LISTEN_STATIC(&gamma_control_mgr->events.set_gamma, setgamma);
|
||||
wlr_scene_set_gamma_control_manager_v1(scene, wlr_gamma_control_manager_v1_create(dpy));
|
||||
|
||||
/* Creates an output layout, which a wlroots utility for working with an
|
||||
* arrangement of screens in a physical layout. */
|
||||
|
|
@ -6157,10 +6133,6 @@ updatemons(struct wl_listener *listener, void *data) {
|
|||
if ((c = focustop(m)) && c->isfullscreen)
|
||||
resize(c, m->m, 0);
|
||||
|
||||
/* Try to re-set the gamma LUT when updating monitors,
|
||||
* it's only really needed when enabling a disabled output, but meh. */
|
||||
m->gamma_lut_changed = 1;
|
||||
|
||||
config_head->state.x = m->m.x;
|
||||
config_head->state.y = m->m.y;
|
||||
if (!selmon) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue