mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Fix crash when adding output
This commit is contained in:
parent
a49e4b13bf
commit
e1955c5c08
3 changed files with 11 additions and 4 deletions
|
@ -351,6 +351,12 @@ bool container_is_floating_or_child(struct sway_container *container);
|
||||||
*/
|
*/
|
||||||
bool container_is_fullscreen_or_child(struct sway_container *container);
|
bool container_is_fullscreen_or_child(struct sway_container *container);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the output which will be used for scale purposes.
|
||||||
|
* This is the most recently entered output.
|
||||||
|
*/
|
||||||
|
struct sway_output *container_get_effective_output(struct sway_container *con);
|
||||||
|
|
||||||
void container_discover_outputs(struct sway_container *con);
|
void container_discover_outputs(struct sway_container *con);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -764,8 +764,7 @@ void container_damage_whole(struct sway_container *container) {
|
||||||
* Return the output which will be used for scale purposes.
|
* Return the output which will be used for scale purposes.
|
||||||
* This is the most recently entered output.
|
* This is the most recently entered output.
|
||||||
*/
|
*/
|
||||||
static struct sway_output *container_get_effective_output(
|
struct sway_output *container_get_effective_output(struct sway_container *con) {
|
||||||
struct sway_container *con) {
|
|
||||||
if (con->outputs->length == 0) {
|
if (con->outputs->length == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -889,8 +889,10 @@ void view_add_mark(struct sway_view *view, char *mark) {
|
||||||
|
|
||||||
static void update_marks_texture(struct sway_view *view,
|
static void update_marks_texture(struct sway_view *view,
|
||||||
struct wlr_texture **texture, struct border_colors *class) {
|
struct wlr_texture **texture, struct border_colors *class) {
|
||||||
struct sway_output *output =
|
struct sway_output *output = container_get_effective_output(view->swayc);
|
||||||
view->swayc->outputs->items[view->swayc->outputs->length - 1];
|
if (!output) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (*texture) {
|
if (*texture) {
|
||||||
wlr_texture_destroy(*texture);
|
wlr_texture_destroy(*texture);
|
||||||
*texture = NULL;
|
*texture = NULL;
|
||||||
|
|
Loading…
Reference in a new issue