Commit ba851315 authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge tag 'v0.1.3' into pureos/amber

phoc 0.1.3
parents 3c56bc59 a4e3b249
phoc (0.1.3) amber; urgency=medium
[ Guido Günther ]
* wlroots: Update submodule
* desktop: Allow to blank/unblank all outputs
* keyboard: Blank/unblank all outputs on power button press (Closes: #86)
-- Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Sat, 23 Nov 2019 00:27:10 +0100
phoc (0.1.2pureos1) amber; urgency=medium
* Upload to amber
......
project('phoc', 'c',
version: '0.1.2',
version: '0.1.3',
license: 'GPLv3+',
meson_version: '>= 0.47.0',
default_options: [
......
......@@ -606,3 +606,23 @@ struct roots_output *desktop_output_from_wlr_output(
}
return NULL;
}
/**
* phoc_desktop_toggle_output_blank:
*
* Blank or unblank all outputs depending on the current state
*/
void
phoc_desktop_toggle_output_blank (PhocDesktop *self)
{
struct roots_output *output;
wl_list_for_each(output, &self->outputs, link) {
gboolean enable = !output->wlr_output->enabled;
wlr_output_enable (output->wlr_output, enable);
if (enable)
output_damage_whole(output);
}
}
......@@ -106,6 +106,7 @@ struct _PhocDesktop {
};
PhocDesktop *phoc_desktop_new (struct roots_config *config);
void phoc_desktop_toggle_output_blank (PhocDesktop *self);
struct roots_output *desktop_output_from_wlr_output(
PhocDesktop *desktop, struct wlr_output *output);
......
......@@ -170,9 +170,10 @@ static bool
keyboard_execute_compositor_binding(PhocKeyboard *self,
xkb_keysym_t keysym)
{
PhocServer *server = phoc_server_get_default ();
if (keysym >= XKB_KEY_XF86Switch_VT_1 &&
keysym <= XKB_KEY_XF86Switch_VT_12) {
PhocServer *server = phoc_server_get_default ();
struct wlr_session *session = wlr_backend_get_session(server->backend);
if (session) {
......@@ -183,6 +184,12 @@ keyboard_execute_compositor_binding(PhocKeyboard *self,
return true;
}
if (keysym == XKB_KEY_XF86PowerDown || keysym == XKB_KEY_XF86PowerOff) {
g_debug ("Power button pressed");
phoc_desktop_toggle_output_blank (server->desktop);
return true;
}
if (keysym == XKB_KEY_Escape) {
wlr_seat_pointer_end_grab(self->seat->seat);
wlr_seat_keyboard_end_grab(self->seat->seat);
......
Subproject commit 1f63d74aefadac829573280979de57baab315555
Subproject commit 059b1e794642830a3ecc73ff6ac8ec35b9d78e16
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