Commit f25ae65c authored by Guido Gunther's avatar Guido Gunther

hack on window tracking

parent 0a0564f5
<protocol name="phosh">
<interface name="phosh_private" version="1">
<interface name="phosh_private" version="2">
<description summary="Phone shell extensions">
Private protocol between phosh and the compositor.
</description>
......@@ -9,13 +9,44 @@
summary="an invalid argument was provided in a request"/>
</enum>
<!-- only one display for now -->
<request name="rotate_display">
<!-- only primary display for now -->
<request name="rotate_display" since="1">
<description summary="rotate display">
Rotate the display clockwise 0, 90, 180 or 270 degree.
Rotate the display clockwise 0, 90, 180 or 270 degree.
</description>
<arg name="surface" type="object" interface="wl_surface"/>
<arg name="degree" type="uint"/>
</request>
<request name="get_app_switcher" since="2">
<arg name="id" type="new_id" interface="phosh_private_app_switcher"/>
</request>
</interface>
<!-- window switch handling -->
<interface name="phosh_private_app_switcher" version="1">
<enum name="error">
<entry name="invalid_argument" value="0"
summary="an invalid argument was provided in a request"/>
</enum>
<request name="list_apps" since="1">
<description summary="Get current views"/>
</request>
<request name="raise_app" since="1">
<description summary="raise the give view"/>
<arg name="app_id" type="string" summary="The app_id of the view"/>
</request>
<event name="app" since="1">
<description summary="advertise available app"/>
<arg name="app_id" type="string" summary="the app_id of a view"/>
</event>
<event name="list_apps_done" since="1">
<description summary="all apps were sent"/>
</event>
</interface>
</protocol>
......@@ -14,6 +14,8 @@
#include "favorites.h"
#include "phosh.h"
#include "phosh-private-client-protocol.h"
#include "phosh-wayland.h"
#include <gio/gdesktopappinfo.h>
......@@ -41,6 +43,44 @@ struct _PhoshFavorites
G_DEFINE_TYPE_WITH_PRIVATE(PhoshFavorites, phosh_favorites, GTK_TYPE_WINDOW)
void handle_app_switcher_app(
void *data, struct phosh_private_app_switcher *phosh_private_app_switcher,
const char *app_id)
{
g_warning ("got app");
}
void handle_app_switcher_list_apps_done(
void *data,
struct phosh_private_app_switcher *phosh_private_app_switcher)
{
g_warning ("got all apps");
}
static const struct phosh_private_app_switcher_listener app_switcher_listener = {
.app = handle_app_switcher_app,
.list_apps_done = handle_app_switcher_list_apps_done,
};
static void
get_apps (PhoshFavorites *self)
{
struct phosh_private *phosh_private;
struct phosh_private_app_switcher *app_switcher;
g_debug("Getting current app list from wlroots");
phosh_private = phosh_wayland_get_phosh_private (
phosh_wayland_get_default ());
g_return_if_fail (phosh_private);
app_switcher = phosh_private_get_app_switcher (phosh_private);
phosh_private_app_switcher_add_listener (app_switcher, &app_switcher_listener, self);
}
static void
term_btn_clicked (PhoshFavorites *self,
GtkButton *btn)
......@@ -222,6 +262,9 @@ phosh_favorites_constructed (GObject *object)
g_signal_connect (priv->settings, "changed::favorites",
G_CALLBACK (favorites_changed), self);
favorites_changed (priv->settings, "favorites", self);
/* Running Apps */
get_apps (self);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment