[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/phoc][upstream/latest] 17 commits: phosh: Allow to bind rebular keys plust <SUPER> modifier

Arnaud Ferraris gitlab at salsa.debian.org
Mon Nov 16 09:21:38 GMT 2020



Arnaud Ferraris pushed to branch upstream/latest at Debian On Mobile / phoc


Commits:
e8d7e081 by Guido Günther at 2020-11-07T11:59:50+00:00
phosh: Allow to bind rebular keys plust <SUPER> modifier

This will help shell keyboard navigation

- - - - -
98e4a12f by Dorota Czaplejewicz at 2020-11-10T15:03:54+00:00
keyboard: Do not override keymap on virtual keyboard

The authoritative source of keymap on virtual keyboards is the virtual-keyboard client. Vhanging its keymap causes the client to start sending invalid keycodes.

This change prevents applying gnome-settings layouts if the seat's keyboard is virtual.

- - - - -
dafa340d by Sebastian Krzyszkowiak at 2020-11-12T04:51:10+01:00
view: Allow to switch outputs of fullscreen surface

This also allows to refresh the surface dimensions when the output
dimensions change.

- - - - -
a5bdd630 by Sebastian Krzyszkowiak at 2020-11-12T04:52:44+01:00
output: Refresh fullscreen view when its output is reconfigured

Fixes #177

- - - - -
35678e14 by Sebastian Krzyszkowiak at 2020-11-13T11:00:30+00:00
gitlab-ci: Don't pull wlroots from sid

We have wlroots in our archive now.

- - - - -
eb0e2f51 by Alexander Mikhaylenko at 2020-11-13T16:50:59+05:00
meson: Compile gschemas on install

- - - - -
1288d599 by Clayton Craft at 2020-11-13T19:36:23+01:00
input: remove unused PhocInput members

These are left over from a copy/paste fail when I implemented PhocInput.

- - - - -
6b77cd07 by Clayton Craft at 2020-11-13T19:36:24+01:00
touch: add new PhocTouch gobject for touch input devices

This implements PhocTouch, a gobject representing touch input devices.

- - - - -
56bd85ee by Clayton Craft at 2020-11-13T19:36:24+01:00
seat: use PhocTouch for touch input devices

- - - - -
06cd1dcc by Guido Günther at 2020-11-14T00:39:07+00:00
gitlab-ci: Remove build artifacts in ..

Otherwise they clutter up debian/output and i don't know
what to pick

- - - - -
8514d7c7 by Guido Günther at 2020-11-14T00:39:07+00:00
output: handle_output_manager_apply: Make both loops use the same logic

The enabled loop uses 'continue' in case the output is disabled. Use
the same pattern in the disabled loop. This avoids one indentation
level but more importantly makes this quicker to grasp.

- - - - -
9bff7222 by Guido Günther at 2020-11-14T00:39:07+00:00
Drop PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT

This is part of wlroots since 0.11.0

- - - - -
9abdcc93 by Guido Günther at 2020-11-14T00:39:07+00:00
output: handle_output_manager_apply: Don't disable already disabled outputs

This makes wlroots finally remove the output although we're only in
power saving mode.

- - - - -
d02e76f0 by Guido Günther at 2020-11-14T00:54:25+00:00
phosh: Define keysym for older libxkb-common

We can drop this once we leave buster behind

- - - - -
bf01c1f4 by Guido Günther at 2020-11-14T00:54:25+00:00
phosh: Allow to bind more keys

This allows to bind keys with modifiers that aren't just shift/caps as
well as common multimedia keys.

- - - - -
9a0587de by Sebastian Krzyszkowiak at 2020-11-14T06:22:58+01:00
virtual: Allow suggested_output usage on recent enough wlroots

- - - - -
fd6351c0 by Sebastian Krzyszkowiak at 2020-11-14T17:57:34+01:00
Document changes and release 0.5.0

- - - - -


20 changed files:

- .gitlab-ci.yml
- + build-aux/post_install.py
- config.h.in
- debian/changelog
- meson.build
- src/desktop.c
- src/desktop.h
- src/input.h
- src/keyboard.c
- src/meson.build
- src/output.c
- src/output.h
- src/phosh.c
- src/seat.c
- src/seat.h
- + src/touch.c
- + src/touch.h
- src/view.c
- src/virtual.c
- subprojects/wlroots


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -28,6 +28,7 @@ variables:
     - ninja -C _build install
 
 .before_script_debian: &before_script_debian
+  - rm -f ../* || true
   - apt-get -y update
   - apt-get -y install $DEPS
   - apt-get -y build-dep .
@@ -136,14 +137,7 @@ package-deb-without-wlroots:
   variables:
     DEB_BUILD_PROFILES: ""
   dependencies: []
-  before_script:
-    - echo "deb http://deb.debian.org/debian/ sid main" > /etc/apt/sources.list.d/sid.list
-    - apt-get -y update
-    # This pulls in wlroots build-deps and so avoids pulling in e.g. mesa from
-    # sid due to pulling wlroots from sid
-    # Once we have wlroots in our archive we can drop the build profile
-    - DEB_BUILD_PROFILES=pkg.phoc.embedwlroots apt-get -y -t buster build-dep .
-    - apt-get -y -t sid install libwlroots-dev meson
+  before_script: *before_script_debian_buster
   script:
     - rm -rf "${L5_WORKING_DIR}"; mkdir -p "${L5_WORKING_DIR}"
     - dpkg-buildpackage -b -uc -us


=====================================
build-aux/post_install.py
=====================================
@@ -0,0 +1,13 @@
+#!/usr/bin/python3
+
+import os
+import subprocess
+import sys
+
+destdir = os.environ.get('DESTDIR', '')
+
+if not destdir and len(sys.argv) > 1:
+    datadir = sys.argv[1]
+
+    print('Compiling gsettings schemas...')
+    subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0', 'schemas')])


=====================================
config.h.in
=====================================
@@ -7,4 +7,3 @@
 
 #mesondefine PHOC_VERSION
 #mesondefine PHOC_XWAYLAND
-#mesondefine PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT


=====================================
debian/changelog
=====================================
@@ -1,3 +1,33 @@
+phoc (0.5.0) amber-phone; urgency=high
+
+  [ Guido Günther ]
+  * phosh: Allow to bind rebular keys plust <SUPER> modifier
+  * gitlab-ci: Remove build artifacts in ..
+  * output: handle_output_manager_apply: Make both loops use the same logic
+  * Drop PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
+  * output: handle_output_manager_apply: Don't disable already disabled outputs
+  * phosh: Define keysym for older libxkb-common
+  * phosh: Allow to bind more keys
+
+  [ Dorota Czaplejewicz ]
+  * keyboard: Do not override keymap on virtual keyboard
+
+  [ Sebastian Krzyszkowiak ]
+  * view: Allow to switch outputs of fullscreen surface
+  * output: Refresh fullscreen view when its output is reconfigured
+  * gitlab-ci: Don't pull wlroots from sid
+  * virtual: Allow suggested_output usage on recent enough wlroots
+
+  [ Alexander Mikhaylenko ]
+  * meson: Compile gschemas on install
+
+  [ Clayton Craft ]
+  * input: remove unused PhocInput members
+  * touch: add new PhocTouch gobject for touch input devices
+  * seat: use PhocTouch for touch input devices
+
+ -- Sebastian Krzyszkowiak <sebastian.krzyszkowiak at puri.sm>  Sat, 14 Nov 2020 17:54:34 +0100
+
 phoc (0.4.4) amber-phone; urgency=medium
 
   [ Guido Günther ]


=====================================
meson.build
=====================================
@@ -1,5 +1,5 @@
 project('phoc', 'c',
-          version: '0.4.4',
+          version: '0.5.0',
           license: 'GPLv3+',
     meson_version: '>= 0.47.0',
   default_options: [
@@ -120,6 +120,11 @@ add_project_arguments(
 
 gnome = import('gnome')
 
+meson.add_install_script(
+  join_paths('build-aux', 'post_install.py'),
+  join_paths(get_option('prefix'), get_option('datadir'))
+)
+
 subdir('protocols')
 subdir('src')
 subdir('tests')
@@ -142,7 +147,6 @@ message('\n'.join(summary))
 config_h = configuration_data()
 config_h.set_quoted('PHOC_VERSION', meson.project_version())
 config_h.set('PHOC_XWAYLAND', have_xwayland)
-config_h.set('PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT', wlroots_has_output_power_management)
 
 configure_file(
   input: 'config.h.in',


=====================================
src/desktop.c
=====================================
@@ -20,9 +20,7 @@
 #include <wlr/types/wlr_input_inhibitor.h>
 #include <wlr/types/wlr_layer_shell_v1.h>
 #include <wlr/types/wlr_output_layout.h>
-#ifdef PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
 #include <wlr/types/wlr_output_power_management_v1.h>
-#endif
 #include <wlr/types/wlr_pointer_constraints_v1.h>
 #include <wlr/types/wlr_server_decoration.h>
 #include <wlr/types/wlr_tablet_v2.h>
@@ -610,14 +608,12 @@ phoc_desktop_constructed (GObject *object)
   wl_signal_add(&self->output_manager_v1->events.test,
 		&self->output_manager_test);
 
-#ifdef PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
   self->output_power_manager_v1 =
     wlr_output_power_manager_v1_create(server->wl_display);
   self->output_power_manager_set_mode.notify =
     phoc_output_handle_output_power_manager_set_mode;
   wl_signal_add(&self->output_power_manager_v1->events.set_mode,
 		&self->output_power_manager_set_mode);
-#endif
 
   wlr_data_control_manager_v1_create(server->wl_display);
 


=====================================
src/desktop.h
=====================================
@@ -86,9 +86,7 @@ struct _PhocDesktop {
 	struct wlr_relative_pointer_manager_v1 *relative_pointer_manager;
 	struct wlr_pointer_gestures_v1 *pointer_gestures;
 	struct wlr_output_manager_v1 *output_manager_v1;
-#ifdef PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
 	struct wlr_output_power_manager_v1 *output_power_manager_v1;
-#endif
 
 	struct wl_listener new_output;
 	struct wl_listener layout_change;
@@ -102,9 +100,7 @@ struct _PhocDesktop {
 	struct wl_listener pointer_constraint;
 	struct wl_listener output_manager_apply;
 	struct wl_listener output_manager_test;
-#ifdef PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
 	struct wl_listener output_power_manager_set_mode;
-#endif
 
 #ifdef PHOC_XWAYLAND
 	struct wlr_xwayland *xwayland;


=====================================
src/input.h
=====================================
@@ -28,9 +28,6 @@ struct _PhocInput {
 
   /* private */
   struct roots_config *config;
-  struct xkb_keymap   *keymap;
-  uint32_t             meta_key;
-  GnomeXkbInfo        *xkbinfo;
 };
 
 PhocInput         *phoc_input_new (struct roots_config *config);


=====================================
src/keyboard.c
=====================================
@@ -443,6 +443,11 @@ on_input_setting_changed (PhocKeyboard *self,
 
   g_debug ("Setting changed, reloading input settings");
 
+  if (wlr_input_device_get_virtual_keyboard(self->device) != NULL) {
+	  g_debug ("Virtual keyboard in use, not switching layout");
+	  return;
+  }
+
   sources = g_settings_get_value(settings, "sources");
 
   g_variant_iter_init (&iter, sources);


=====================================
src/meson.build
=====================================
@@ -15,6 +15,7 @@ sources = [
   'server.c',
   'switch.c',
   'text_input.c',
+  'touch.c',
   'utils.c',
   'view.c',
   'virtual.c',


=====================================
src/output.c
=====================================
@@ -11,9 +11,7 @@
 #include <wlr/config.h>
 #include <wlr/types/wlr_compositor.h>
 #include <wlr/types/wlr_output_layout.h>
-#ifdef PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
 #include <wlr/types/wlr_output_power_management_v1.h>
-#endif
 #include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/util/log.h>
 #include <wlr/util/region.h>
@@ -513,19 +511,24 @@ void handle_output_manager_apply(struct wl_listener *listener, void *data) {
 	// First disable outputs we need to disable
 	wl_list_for_each(config_head, &config->heads, link) {
 		struct wlr_output *wlr_output = config_head->state.output;
-		if (!config_head->state.enabled) {
-			wlr_output_enable(wlr_output, false);
-			wlr_output_layout_remove(desktop->layout, wlr_output);
-			ok &= wlr_output_commit(wlr_output);
-		}
+		if (config_head->state.enabled)
+			continue;
+
+		if (!wlr_output->enabled)
+			continue;
+
+		wlr_output_enable(wlr_output, false);
+		wlr_output_layout_remove(desktop->layout, wlr_output);
+		ok &= wlr_output_commit(wlr_output);
 	}
 
 	// Then enable outputs that need to
 	wl_list_for_each(config_head, &config->heads, link) {
 		struct wlr_output *wlr_output = config_head->state.output;
-		if (!config_head->state.enabled) {
+
+		if (!config_head->state.enabled)
 			continue;
-		}
+
 		wlr_output_enable(wlr_output, true);
 		if (config_head->state.mode != NULL) {
 			wlr_output_set_mode(wlr_output, config_head->state.mode);
@@ -539,7 +542,11 @@ void handle_output_manager_apply(struct wl_listener *listener, void *data) {
 			config_head->state.x, config_head->state.y);
 		wlr_output_set_transform(wlr_output, config_head->state.transform);
 		wlr_output_set_scale(wlr_output, config_head->state.scale);
+		struct roots_output *output = wlr_output->data;
 		ok &= wlr_output_commit(wlr_output);
+		if (output->fullscreen_view) {
+			view_set_fullscreen(output->fullscreen_view, true, wlr_output);
+		}
 	}
 
 	if (ok) {
@@ -562,7 +569,6 @@ void handle_output_manager_test(struct wl_listener *listener, void *data) {
 	wlr_output_configuration_v1_destroy(config);
 }
 
-#ifdef PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
 void
 phoc_output_handle_output_power_manager_set_mode(struct wl_listener *listener, void *data)
 {
@@ -599,7 +605,6 @@ phoc_output_handle_output_power_manager_set_mode(struct wl_listener *listener, v
   if (enable)
     output_damage_whole (self);
 }
-#endif
 
 static void output_destroy(struct roots_output *output) {
 	// TODO: cursor


=====================================
src/output.h
=====================================
@@ -66,9 +66,7 @@ void output_for_each_surface(struct roots_output *output,
 void handle_new_output(struct wl_listener *listener, void *data);
 void handle_output_manager_apply(struct wl_listener *listener, void *data);
 void handle_output_manager_test(struct wl_listener *listener, void *data);
-#ifdef PHOC_HAS_WLR_OUTPUT_POWER_MANAGEMENT
 void phoc_output_handle_output_power_manager_set_mode(struct wl_listener *listener, void *data);
-#endif
 
 struct roots_view;
 struct roots_drag_icon;


=====================================
src/phosh.c
=====================================
@@ -26,6 +26,11 @@
 #include "render.h"
 #include "utils.h"
 
+/* help older (0.8.2) libxkbcommon */
+#ifndef XKB_KEY_XF86RotationLockToggle
+# define XKB_KEY_XF86RotationLockToggle 0x1008FFB7
+#endif
+
 struct phosh_private_keyboard_event_data {
   GHashTable *subscribed_accelerators;
   struct wl_resource *resource;
@@ -149,28 +154,17 @@ phosh_private_accelerator_already_subscribed (PhocKeyCombo *combo)
 }
 
 static bool
-keysym_is_media (xkb_keysym_t keysym)
+keysym_is_subscribeable (PhocKeyCombo *combo)
 {
-  switch (keysym) {
-  case XKB_KEY_XF86AudioLowerVolume:
-  case XKB_KEY_XF86AudioRaiseVolume:
-  case XKB_KEY_XF86AudioMute:
-  case XKB_KEY_XF86AudioMicMute:
-  case XKB_KEY_XF86AudioPlay:
-  case XKB_KEY_XF86AudioPause:
-  case XKB_KEY_XF86AudioStop:
-  case XKB_KEY_XF86AudioNext:
-  case XKB_KEY_XF86AudioPrev:
+  /* Allow to bind all keys with modifiers that aren't just shift/caps */
+  if (combo->modifiers >= WLR_MODIFIER_CTRL)
     return true;
-  default:
-    return false;
-  }
-}
 
-static bool
-keysym_is_subscribeable (xkb_keysym_t keysym)
-{
-  return keysym_is_media (keysym);
+  /* keys on multi media keyboards */
+  if (combo->keysym >= XKB_KEY_XF86MonBrightnessUp && combo->keysym <= XKB_KEY_XF86RotationLockToggle)
+    return true;
+
+  return false;
 }
 
 static void
@@ -196,7 +190,7 @@ phosh_private_keyboard_event_grab_accelerator_request (struct wl_client   *wl_cl
     return;
   }
 
-  if (!keysym_is_subscribeable (combo->keysym)) {
+  if (!keysym_is_subscribeable (combo)) {
     g_debug ("Requested keysym %s is not subscribeable!", accelerator);
 
     phosh_private_keyboard_event_send_grab_failed_event (resource,


=====================================
src/seat.c
=====================================
@@ -24,6 +24,7 @@
 #include "keyboard.h"
 #include "seat.h"
 #include "text_input.h"
+#include "touch.h"
 #include "xcursor.h"
 
 static void handle_keyboard_key(struct wl_listener *listener, void *data) {
@@ -460,7 +461,7 @@ void roots_seat_configure_cursor(struct roots_seat *seat) {
 	struct wlr_cursor *cursor = seat->cursor->cursor;
 
 	struct roots_pointer *pointer;
-	struct roots_touch *touch;
+	PhocTouch *touch;
 	struct roots_tablet *tablet;
 	struct roots_output *output;
 
@@ -907,29 +908,21 @@ static void seat_add_switch(struct roots_seat *seat,
 }
 
 static void handle_touch_destroy(struct wl_listener *listener, void *data) {
-	struct roots_touch *touch =
-		wl_container_of(listener, touch, device_destroy);
+	PhocTouch *touch = wl_container_of(listener, touch, device_destroy);
 	struct roots_seat *seat = touch->seat;
 
 	wl_list_remove(&touch->link);
 	wlr_cursor_detach_input_device(seat->cursor->cursor, touch->device);
 	wl_list_remove(&touch->device_destroy.link);
-	free(touch);
+	g_object_unref (touch);
 
 	seat_update_capabilities(seat);
 }
 
 static void seat_add_touch(struct roots_seat *seat,
 		struct wlr_input_device *device) {
-	struct roots_touch *touch = calloc(1, sizeof(struct roots_touch));
-	if (!touch) {
-		wlr_log(WLR_ERROR, "could not allocate touch for seat");
-		return;
-	}
+	PhocTouch *touch = phoc_touch_new (device, seat);
 
-	device->data = touch;
-	touch->device = device;
-	touch->seat = seat;
 	wl_list_insert(&seat->touch, &touch->link);
 
 	touch->device_destroy.notify = handle_touch_destroy;


=====================================
src/seat.h
=====================================
@@ -78,13 +78,6 @@ struct roots_pointer {
 	struct wl_list link;
 };
 
-struct roots_touch {
-	struct roots_seat *seat;
-	struct wlr_input_device *device;
-	struct wl_listener device_destroy;
-	struct wl_list link;
-};
-
 struct roots_tablet {
 	struct roots_seat *seat;
 	struct wlr_input_device *device;


=====================================
src/touch.c
=====================================
@@ -0,0 +1,133 @@
+#define G_LOG_DOMAIN "phoc-touch"
+
+#include "config.h"
+
+#define _POSIX_C_SOURCE 200112L
+#include <assert.h>
+#include <stdlib.h>
+#include <time.h>
+#include <wayland-server-core.h>
+#include <wlr/backend/libinput.h>
+#include <wlr/config.h>
+#include <wlr/types/wlr_cursor.h>
+#include <wlr/util/log.h>
+#include <wlr/xcursor.h>
+#ifdef PHOC_XWAYLAND
+#include <wlr/xwayland.h>
+#endif
+#include "touch.h"
+#include "seat.h"
+
+G_DEFINE_TYPE (PhocTouch, phoc_touch, G_TYPE_OBJECT);
+
+enum {
+  PROP_0,
+  PROP_SEAT,
+  PROP_DEVICE,
+  PROP_LAST_PROP
+};
+static GParamSpec *props[PROP_LAST_PROP];
+
+static void
+phoc_touch_set_property (GObject      *object,
+                         guint         property_id,
+                         const GValue *value,
+                         GParamSpec   *pspec)
+{
+  PhocTouch *self = PHOC_TOUCH (object);
+
+  switch (property_id) {
+  case PROP_DEVICE:
+    self->device = g_value_get_pointer (value);
+    self->device->data = self;
+    g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DEVICE]);
+    break;
+  case PROP_SEAT:
+    self->seat = g_value_get_pointer (value);
+    g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SEAT]);
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    break;
+  }
+}
+
+static void
+phoc_touch_get_property (GObject    *object,
+                         guint       property_id,
+                         GValue     *value,
+                         GParamSpec *pspec)
+{
+  PhocTouch *self = PHOC_TOUCH (object);
+
+  switch (property_id) {
+  case PROP_DEVICE:
+    g_value_set_pointer (value, self->device);
+    break;
+  case PROP_SEAT:
+    g_value_set_pointer (value, self->seat);
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    break;
+  }
+}
+
+static void
+phoc_touch_init (PhocTouch *self)
+{
+}
+
+PhocTouch *
+phoc_touch_new (struct wlr_input_device *device, struct roots_seat *seat)
+{
+  return g_object_new (PHOC_TYPE_TOUCH,
+                       "device", device,
+                       "seat", seat,
+                       NULL);
+}
+
+static void
+phoc_touch_constructed (GObject *object)
+{
+  G_OBJECT_CLASS (phoc_touch_parent_class)->constructed (object);
+}
+
+static void
+phoc_touch_finalize (GObject *object)
+{
+  G_OBJECT_CLASS (phoc_touch_parent_class)->finalize (object);
+}
+
+static void
+phoc_touch_dispose (GObject *object)
+{
+  G_OBJECT_CLASS (phoc_touch_parent_class)->dispose (object);
+}
+
+static void
+phoc_touch_class_init (PhocTouchClass *klass)
+{
+  GObjectClass *object_class = (GObjectClass *)klass;
+
+  object_class->set_property = phoc_touch_set_property;
+  object_class->get_property = phoc_touch_get_property;
+
+  object_class->constructed = phoc_touch_constructed;
+  object_class->dispose = phoc_touch_dispose;
+  object_class->finalize = phoc_touch_finalize;
+
+  props[PROP_DEVICE] =
+    g_param_spec_pointer (
+      "device",
+      "Device",
+      "The device object",
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
+  props[PROP_SEAT] =
+    g_param_spec_pointer (
+      "seat",
+      "Seat",
+      "The seat object",
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
+  g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
+}


=====================================
src/touch.h
=====================================
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <wayland-server-core.h>
+#include <wlr/types/wlr_cursor.h>
+#include <wlr/types/wlr_input_device.h>
+#include <wlr/types/wlr_seat.h>
+#include "settings.h"
+
+#define PHOC_TYPE_TOUCH (phoc_touch_get_type ())
+
+G_DECLARE_FINAL_TYPE (PhocTouch, phoc_touch, PHOC, TOUCH, GObject);
+
+/* These need to know about PhocTouch so we have them after the type definition.
+ * This will fix itself once output / view / phosh are gobjects and most of
+ * their members are non-public. */
+#include "output.h"
+#include "cursor.h"
+#include "server.h"
+#include "seat.h"
+#include "view.h"
+
+/* TODO: we keep the struct public due to the list links and
+   notifiers but we should avoid other member access */
+struct _PhocTouch {
+  GObject                  parent;
+
+  struct wl_list           link; // seat::touch
+  struct wl_listener       device_destroy;
+  struct roots_seat       *seat;
+  struct wlr_input_device *device;
+
+};
+
+PhocTouch *phoc_touch_new (struct wlr_input_device *device,
+                           struct roots_seat       *seat);


=====================================
src/view.c
=====================================
@@ -360,23 +360,21 @@ view_auto_maximize(struct roots_view *view)
 void view_set_fullscreen(struct roots_view *view, bool fullscreen,
 		struct wlr_output *output) {
 	bool was_fullscreen = view->fullscreen_output != NULL;
-	if (was_fullscreen == fullscreen) {
-		// TODO: support changing the output?
-		return;
-	}
 
 	// TODO: check if client is focused?
 
-	if (view->impl->set_fullscreen) {
-		view->impl->set_fullscreen(view, fullscreen);
-	}
+	if (!was_fullscreen) {
+		if (view->impl->set_fullscreen) {
+			view->impl->set_fullscreen(view, fullscreen);
+		}
 
-	if (view->toplevel_handle) {
-		wlr_foreign_toplevel_handle_v1_set_fullscreen(view->toplevel_handle,
-				fullscreen);
+		if (view->toplevel_handle) {
+			wlr_foreign_toplevel_handle_v1_set_fullscreen(view->toplevel_handle,
+					fullscreen);
+		}
 	}
 
-	if (!was_fullscreen && fullscreen) {
+	if (fullscreen) {
 		if (output == NULL) {
 			output = view_get_output(view);
 		}
@@ -385,6 +383,10 @@ void view_set_fullscreen(struct roots_view *view, bool fullscreen,
 			return;
 		}
 
+		if (was_fullscreen) {
+			view->fullscreen_output->fullscreen_view = NULL;
+		}
+
 		struct wlr_box view_box;
 		view_get_box(view, &view_box);
 


=====================================
src/virtual.c
=====================================
@@ -4,6 +4,7 @@
 
 #define _POSIX_C_SOURCE 199309L
 #include <wlr/types/wlr_virtual_keyboard_v1.h>
+#include <wlr/version.h>
 #include "virtual.h"
 #include "seat.h"
 
@@ -45,7 +46,7 @@ phoc_handle_virtual_pointer(struct wl_listener *listener, void *data)
 
   roots_seat_add_device (seat, device);
 
-#if 0 /* TODO: can be enabled after next wlroots release */
+#if WLR_VERSION_MAJOR > 0 || WLR_VERSION_MINOR >= 11
   if (event->suggested_output) {
     wlr_cursor_map_input_to_output(seat->cursor->cursor, device,
 				   event->suggested_output);


=====================================
subprojects/wlroots
=====================================
@@ -1 +1 @@
-Subproject commit 7723a09a226d812aa51d1439c2b5e8e21238d45c
+Subproject commit 3d227f140e3c4af42d759477fc38e82a4c3dc4ef



View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/phoc/-/compare/b3b55d1106e2549b5c1afe0132c5b3c92255f21a...fd6351c0f4ee7af38ff60c96e211d4ff2a5f3ad9

-- 
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/phoc/-/compare/b3b55d1106e2549b5c1afe0132c5b3c92255f21a...fd6351c0f4ee7af38ff60c96e211d4ff2a5f3ad9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20201116/a9fb48d7/attachment-0001.html>


More information about the Debian-on-mobile-maintainers mailing list