Skip to content
Snippets Groups Projects
Commit 9d27ee89 authored by Guido Gunther's avatar Guido Gunther :zzz:
Browse files

phosh: Add method to get the primary monitor

This avoids opencoding it in lot of places (See #20)
parent 5a3beca7
No related branches found
No related tags found
No related merge requests found
......@@ -868,6 +868,19 @@ phosh_shell_get_wl_layer_shell ()
}
PhoshMonitor *
phosh_shell_get_primary_monitor ()
{
PhoshShellPrivate *priv = phosh_shell_get_instance_private (_phosh);
PhoshMonitor *monitor;
monitor = phosh_monitor_manager_get_monitor (priv->monitor_manager, 0);
g_return_val_if_fail (monitor, NULL);
return monitor;
}
/**
* Returns the usable area in pixels usable by a client on the phone
* display
......
......@@ -8,6 +8,8 @@
#ifndef PHOSH_H
#define PHOSH_H
#include "monitor/monitor.h"
#include <gtk/gtk.h>
#define PHOSH_TYPE_SHELL phosh_shell_get_type()
......@@ -25,6 +27,7 @@ void phosh_shell_get_usable_area (PhoshShell *self,
void phosh_shell_set_locked (PhoshShell *self, gboolean locked);
void phosh_shell_lock (PhoshShell *self);
void phosh_shell_unlock (PhoshShell *self);
PhoshMonitor *phosh_shell_get_primary_monitor ();
/* Phosh keeps track of the wayland globals */
gpointer phosh_shell_get_wl_layer_shell ();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment