mirror of
https://github.com/labwc/labwc.git
synced 2026-02-20 01:40:22 -05:00
output: Add output_is_usable() helper
This commit is contained in:
parent
fe7edf82d9
commit
6efc6a9db4
5 changed files with 20 additions and 18 deletions
|
|
@ -26,7 +26,7 @@ static void
|
|||
output_frame_notify(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct output *output = wl_container_of(listener, output, frame);
|
||||
if (!output->wlr_output->enabled) {
|
||||
if (!output_is_usable(output)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -458,6 +458,13 @@ output_from_wlr_output(struct server *server, struct wlr_output *wlr_output)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
output_is_usable(struct output *output)
|
||||
{
|
||||
/* output_is_usable(NULL) is safe and returns false */
|
||||
return output && output->wlr_output->enabled && !output->leased;
|
||||
}
|
||||
|
||||
/* returns true if usable area changed */
|
||||
static bool
|
||||
update_usable_area(struct output *output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue