mirror of
https://github.com/swaywm/sway.git
synced 2026-04-17 06:46:32 -04:00
Merge branch 'master' into smarter-auto-orientation
This commit is contained in:
commit
6e82019b7a
4 changed files with 18 additions and 3 deletions
|
|
@ -33,6 +33,7 @@ struct sway_layer_popup {
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
struct wl_listener new_popup;
|
struct wl_listener new_popup;
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
|
struct wl_listener reposition;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sway_output;
|
struct sway_output;
|
||||||
|
|
|
||||||
|
|
@ -556,8 +556,10 @@ static void queue_output_config(struct output_config *oc,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hdr = oc && oc->hdr == 1;
|
bool hdr = oc && oc->hdr == 1;
|
||||||
if (hdr && oc->color_transform != NULL) {
|
bool color_profile = oc && (oc->color_transform != NULL
|
||||||
sway_log(SWAY_ERROR, "Cannot HDR on output %s: output has an ICC profile set", wlr_output->name);
|
|| oc->color_profile == COLOR_PROFILE_TRANSFORM_WITH_DEVICE_PRIMARIES);
|
||||||
|
if (hdr && color_profile) {
|
||||||
|
sway_log(SWAY_ERROR, "Cannot use HDR on output %s: output has a color profile set", wlr_output->name);
|
||||||
hdr = false;
|
hdr = false;
|
||||||
}
|
}
|
||||||
set_hdr(wlr_output, pending, hdr);
|
set_hdr(wlr_output, pending, hdr);
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,10 @@ static bool criteria_matches_view(struct criteria *criteria,
|
||||||
struct sway_container *focus = seat_get_focused_container(seat);
|
struct sway_container *focus = seat_get_focused_container(seat);
|
||||||
struct sway_view *focused = focus ? focus->view : NULL;
|
struct sway_view *focused = focus ? focus->view : NULL;
|
||||||
|
|
||||||
|
if (!view->container) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (criteria->title) {
|
if (criteria->title) {
|
||||||
const char *title = view_get_title(view);
|
const char *title = view_get_title(view);
|
||||||
if (!title) {
|
if (!title) {
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,7 @@ static void popup_handle_destroy(struct wl_listener *listener, void *data) {
|
||||||
wl_list_remove(&popup->destroy.link);
|
wl_list_remove(&popup->destroy.link);
|
||||||
wl_list_remove(&popup->new_popup.link);
|
wl_list_remove(&popup->new_popup.link);
|
||||||
wl_list_remove(&popup->commit.link);
|
wl_list_remove(&popup->commit.link);
|
||||||
|
wl_list_remove(&popup->reposition.link);
|
||||||
free(popup);
|
free(popup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -356,6 +357,11 @@ static void popup_handle_commit(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void popup_handle_reposition(struct wl_listener *listener, void *data) {
|
||||||
|
struct sway_layer_popup *popup = wl_container_of(listener, popup, reposition);
|
||||||
|
popup_unconstrain(popup);
|
||||||
|
}
|
||||||
|
|
||||||
static void popup_handle_new_popup(struct wl_listener *listener, void *data);
|
static void popup_handle_new_popup(struct wl_listener *listener, void *data);
|
||||||
|
|
||||||
static struct sway_layer_popup *create_popup(struct wlr_xdg_popup *wlr_popup,
|
static struct sway_layer_popup *create_popup(struct wlr_xdg_popup *wlr_popup,
|
||||||
|
|
@ -376,11 +382,13 @@ static struct sway_layer_popup *create_popup(struct wlr_xdg_popup *wlr_popup,
|
||||||
}
|
}
|
||||||
|
|
||||||
popup->destroy.notify = popup_handle_destroy;
|
popup->destroy.notify = popup_handle_destroy;
|
||||||
wl_signal_add(&wlr_popup->base->events.destroy, &popup->destroy);
|
wl_signal_add(&wlr_popup->events.destroy, &popup->destroy);
|
||||||
popup->new_popup.notify = popup_handle_new_popup;
|
popup->new_popup.notify = popup_handle_new_popup;
|
||||||
wl_signal_add(&wlr_popup->base->events.new_popup, &popup->new_popup);
|
wl_signal_add(&wlr_popup->base->events.new_popup, &popup->new_popup);
|
||||||
popup->commit.notify = popup_handle_commit;
|
popup->commit.notify = popup_handle_commit;
|
||||||
wl_signal_add(&wlr_popup->base->surface->events.commit, &popup->commit);
|
wl_signal_add(&wlr_popup->base->surface->events.commit, &popup->commit);
|
||||||
|
popup->reposition.notify = popup_handle_reposition;
|
||||||
|
wl_signal_add(&wlr_popup->events.reposition, &popup->reposition);
|
||||||
|
|
||||||
return popup;
|
return popup;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue