Compare commits
13 Commits
3.30.1
...
wip/carlos
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e5dd9b8fbc | ||
![]() |
83f496229b | ||
![]() |
0fea0e383c | ||
![]() |
92cccf53df | ||
![]() |
4282067e24 | ||
![]() |
85e9784a22 | ||
![]() |
49fea735aa | ||
![]() |
8200995fdb | ||
![]() |
71a62bb18f | ||
![]() |
76abe87090 | ||
![]() |
62775d1913 | ||
![]() |
e24947a460 | ||
![]() |
d387aa428a |
@@ -293,13 +293,6 @@ on_device_added (ClutterDeviceManager *device_manager,
|
||||
create_device_monitor (backend, device_id);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
device_is_slave_touchscreen (ClutterInputDevice *device)
|
||||
{
|
||||
return (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER &&
|
||||
clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
check_has_pointing_device (ClutterDeviceManager *manager)
|
||||
{
|
||||
@@ -316,6 +309,9 @@ check_has_pointing_device (ClutterDeviceManager *manager)
|
||||
if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE ||
|
||||
clutter_input_device_get_device_type (device) == CLUTTER_KEYBOARD_DEVICE)
|
||||
continue;
|
||||
if (clutter_input_device_get_device_type (device) == CLUTTER_TABLET_DEVICE &&
|
||||
meta_is_wayland_compositor ())
|
||||
continue;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -324,9 +320,10 @@ check_has_pointing_device (ClutterDeviceManager *manager)
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
check_has_slave_touchscreen (ClutterDeviceManager *manager)
|
||||
check_pointer_visibility (ClutterDeviceManager *manager)
|
||||
{
|
||||
const GSList *devices;
|
||||
gboolean pointer_visible = TRUE;
|
||||
|
||||
devices = clutter_device_manager_peek_devices (manager);
|
||||
|
||||
@@ -334,12 +331,19 @@ check_has_slave_touchscreen (ClutterDeviceManager *manager)
|
||||
{
|
||||
ClutterInputDevice *device = devices->data;
|
||||
|
||||
if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER &&
|
||||
clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE)
|
||||
return TRUE;
|
||||
if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_SLAVE)
|
||||
continue;
|
||||
|
||||
if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE ||
|
||||
(clutter_input_device_get_device_type (device) == CLUTTER_TABLET_DEVICE &&
|
||||
meta_is_wayland_compositor ()))
|
||||
{
|
||||
pointer_visible = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return pointer_visible;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -359,26 +363,16 @@ on_device_removed (ClutterDeviceManager *device_manager,
|
||||
if (priv->current_device_id == device_id)
|
||||
{
|
||||
MetaCursorTracker *cursor_tracker = priv->cursor_tracker;
|
||||
gboolean has_touchscreen, has_pointing_device;
|
||||
ClutterInputDeviceType device_type;
|
||||
gboolean pointer_hidden, has_pointing_device;
|
||||
|
||||
priv->current_device_id = 0;
|
||||
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
has_touchscreen = check_has_slave_touchscreen (device_manager);
|
||||
pointer_hidden = !check_pointer_visibility (device_manager);
|
||||
has_pointing_device = check_has_pointing_device (device_manager);
|
||||
|
||||
if (device_type == CLUTTER_TOUCHSCREEN_DEVICE && has_touchscreen)
|
||||
{
|
||||
/* There's more touchscreens left, keep the pointer hidden */
|
||||
meta_cursor_tracker_set_pointer_visible (cursor_tracker, FALSE);
|
||||
}
|
||||
else if (device_type != CLUTTER_KEYBOARD_DEVICE)
|
||||
{
|
||||
has_pointing_device = check_has_pointing_device (device_manager);
|
||||
meta_cursor_tracker_set_pointer_visible (cursor_tracker,
|
||||
has_pointing_device &&
|
||||
!has_touchscreen);
|
||||
}
|
||||
meta_cursor_tracker_set_pointer_visible (cursor_tracker,
|
||||
has_pointing_device &&
|
||||
!pointer_hidden);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,20 +399,11 @@ set_initial_pointer_visibility (MetaBackend *backend,
|
||||
ClutterDeviceManager *device_manager)
|
||||
{
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
const GSList *devices;
|
||||
const GSList *l;
|
||||
gboolean has_touchscreen = FALSE;
|
||||
|
||||
devices = clutter_device_manager_peek_devices (device_manager);
|
||||
for (l = devices; l; l = l->next)
|
||||
{
|
||||
ClutterInputDevice *device = l->data;
|
||||
|
||||
has_touchscreen |= device_is_slave_touchscreen (device);
|
||||
}
|
||||
gboolean pointer_visible;
|
||||
|
||||
pointer_visible = check_pointer_visibility (device_manager);
|
||||
meta_cursor_tracker_set_pointer_visible (priv->cursor_tracker,
|
||||
!has_touchscreen);
|
||||
pointer_visible);
|
||||
}
|
||||
|
||||
static MetaInputSettings *
|
||||
@@ -1054,6 +1039,12 @@ update_last_device (MetaBackend *backend)
|
||||
{
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
break;
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
if (meta_is_wayland_compositor ())
|
||||
meta_cursor_tracker_set_pointer_visible (cursor_tracker, FALSE);
|
||||
else
|
||||
meta_cursor_tracker_set_pointer_visible (cursor_tracker, TRUE);
|
||||
break;
|
||||
case CLUTTER_TOUCHSCREEN_DEVICE:
|
||||
meta_cursor_tracker_set_pointer_visible (cursor_tracker, FALSE);
|
||||
break;
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017 Red Hat
|
||||
* Copyright (c) 2018 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@@ -257,6 +258,8 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
|
||||
g_assert (n_connectors > 0);
|
||||
g_free (connectors);
|
||||
|
||||
g_assert (fb_id != 0);
|
||||
|
||||
if (!gpu_kms->page_flips_not_supported)
|
||||
{
|
||||
MetaGpuKmsFlipClosureContainer *closure_container;
|
||||
|
@@ -1900,6 +1900,12 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
||||
CoglFrameInfo *frame_info;
|
||||
gboolean egl_context_changed = FALSE;
|
||||
|
||||
/*
|
||||
* Wait for the flip callback before continuing, as we might have started the
|
||||
* animation earlier due to the animation being driven by some other monitor.
|
||||
*/
|
||||
wait_for_pending_flips (onscreen);
|
||||
|
||||
frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos);
|
||||
frame_info->global_frame_counter = renderer_native->frame_counter;
|
||||
|
||||
@@ -1909,12 +1915,6 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
||||
rectangles,
|
||||
n_rectangles);
|
||||
|
||||
/*
|
||||
* Wait for the flip callback before continuing, as we might have started the
|
||||
* animation earlier due to the animation being driven by some other monitor.
|
||||
*/
|
||||
wait_for_pending_flips (onscreen);
|
||||
|
||||
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
||||
render_gpu);
|
||||
switch (renderer_gpu_data->mode)
|
||||
|
@@ -516,6 +516,7 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
||||
}
|
||||
else
|
||||
{
|
||||
opaque_tex_region = NULL;
|
||||
use_opaque_region = FALSE;
|
||||
}
|
||||
|
||||
@@ -659,6 +660,8 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
||||
}
|
||||
}
|
||||
|
||||
g_clear_pointer (&clip_tex_region, cairo_region_destroy);
|
||||
g_clear_pointer (&opaque_tex_region, cairo_region_destroy);
|
||||
g_clear_pointer (&blended_tex_region, cairo_region_destroy);
|
||||
}
|
||||
|
||||
|
@@ -787,7 +787,7 @@ constrain_custom_rule (MetaWindow *window,
|
||||
MetaPlacementRule *placement_rule;
|
||||
MetaRectangle intersection;
|
||||
gboolean constraint_satisfied;
|
||||
MetaPlacementRule *current_rule;
|
||||
MetaPlacementRule current_rule;
|
||||
MetaWindow *parent;
|
||||
MetaRectangle parent_rect;
|
||||
|
||||
@@ -820,25 +820,24 @@ constrain_custom_rule (MetaWindow *window,
|
||||
if (check_only)
|
||||
return constraint_satisfied;
|
||||
|
||||
current_rule = g_new0 (MetaPlacementRule, 1);
|
||||
*current_rule = *placement_rule;
|
||||
current_rule = *placement_rule;
|
||||
|
||||
if (constraint_satisfied)
|
||||
goto done;
|
||||
|
||||
if (info->current.width != intersection.width &&
|
||||
(current_rule->constraint_adjustment &
|
||||
(current_rule.constraint_adjustment &
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_X))
|
||||
{
|
||||
try_flip_window_position (window, info, current_rule,
|
||||
try_flip_window_position (window, info, ¤t_rule,
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_X,
|
||||
&info->current, &intersection);
|
||||
}
|
||||
if (info->current.height != intersection.height &&
|
||||
(current_rule->constraint_adjustment &
|
||||
(current_rule.constraint_adjustment &
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_Y))
|
||||
{
|
||||
try_flip_window_position (window, info, current_rule,
|
||||
try_flip_window_position (window, info, ¤t_rule,
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_Y,
|
||||
&info->current, &intersection);
|
||||
}
|
||||
@@ -852,7 +851,7 @@ constrain_custom_rule (MetaWindow *window,
|
||||
if (constraint_satisfied)
|
||||
goto done;
|
||||
|
||||
if (current_rule->constraint_adjustment &
|
||||
if (current_rule.constraint_adjustment &
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_SLIDE_X)
|
||||
{
|
||||
if (info->current.x != intersection.x)
|
||||
@@ -860,7 +859,7 @@ constrain_custom_rule (MetaWindow *window,
|
||||
else if (info->current.width != intersection.width)
|
||||
info->current.x -= info->current.width - intersection.width;
|
||||
}
|
||||
if (current_rule->constraint_adjustment &
|
||||
if (current_rule.constraint_adjustment &
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_SLIDE_Y)
|
||||
{
|
||||
if (info->current.y != intersection.y)
|
||||
@@ -878,13 +877,13 @@ constrain_custom_rule (MetaWindow *window,
|
||||
if (constraint_satisfied)
|
||||
goto done;
|
||||
|
||||
if (current_rule->constraint_adjustment &
|
||||
if (current_rule.constraint_adjustment &
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_RESIZE_X)
|
||||
{
|
||||
info->current.x = intersection.x;
|
||||
info->current.width = intersection.width;
|
||||
}
|
||||
if (current_rule->constraint_adjustment &
|
||||
if (current_rule.constraint_adjustment &
|
||||
META_PLACEMENT_CONSTRAINT_ADJUSTMENT_RESIZE_Y)
|
||||
{
|
||||
info->current.y = intersection.y;
|
||||
|
@@ -496,6 +496,8 @@ meta_workspace_manager_override_workspace_layout (MetaWorkspaceManager *workspac
|
||||
int n_rows,
|
||||
int n_columns)
|
||||
{
|
||||
workspace_manager->workspace_layout_overridden = FALSE;
|
||||
|
||||
meta_workspace_manager_update_workspace_layout (workspace_manager,
|
||||
starting_corner,
|
||||
vertical_layout,
|
||||
|
@@ -418,7 +418,7 @@ meta_wayland_tablet_tool_new (MetaWaylandTabletSeat *seat,
|
||||
tool->focus_surface_destroy_listener.notify = tablet_tool_handle_focus_surface_destroy;
|
||||
tool->cursor_surface_destroy_listener.notify = tablet_tool_handle_cursor_surface_destroy;
|
||||
|
||||
tool->default_sprite = meta_cursor_sprite_xcursor_new (META_CURSOR_CROSSHAIR);
|
||||
tool->default_sprite = meta_cursor_sprite_xcursor_new (META_CURSOR_DEFAULT);
|
||||
tool->prepare_at_signal_id =
|
||||
g_signal_connect (tool->default_sprite, "prepare-at",
|
||||
G_CALLBACK (tool_cursor_prepare_at), tool);
|
||||
|
@@ -503,7 +503,8 @@ text_input_commit_state (struct wl_client *client,
|
||||
clutter_input_method_focus_out (input_method);
|
||||
}
|
||||
}
|
||||
else if (!clutter_input_focus_is_focused (focus))
|
||||
|
||||
if (!clutter_input_focus_is_focused (focus))
|
||||
return;
|
||||
|
||||
if (text_input->pending_state & META_WAYLAND_PENDING_STATE_CONTENT_TYPE)
|
||||
|
@@ -651,10 +651,7 @@ reload_wm_name (MetaWindow *window,
|
||||
|
||||
if (value->type != META_PROP_VALUE_INVALID)
|
||||
{
|
||||
g_autofree gchar *title = g_convert (value->v.str, -1,
|
||||
"UTF-8", "LATIN1",
|
||||
NULL, NULL, NULL);
|
||||
set_window_title (window, title);
|
||||
set_window_title (window, value->v.str);
|
||||
|
||||
meta_verbose ("Using WM_NAME for new title of %s: \"%s\"\n",
|
||||
window->desc, window->title);
|
||||
|
@@ -639,6 +639,7 @@ text_property_to_utf8 (Display *xdisplay,
|
||||
{
|
||||
char *ret = NULL;
|
||||
char **local_list = NULL;
|
||||
const char *charset = NULL;
|
||||
int count = 0;
|
||||
int res;
|
||||
|
||||
@@ -649,7 +650,10 @@ text_property_to_utf8 (Display *xdisplay,
|
||||
if (count == 0)
|
||||
goto out;
|
||||
|
||||
ret = g_strdup (local_list[0]);
|
||||
if (g_get_charset (&charset))
|
||||
ret = g_strdup (local_list[0]);
|
||||
else
|
||||
ret = g_convert (local_list[0], -1, "UTF-8", charset, NULL, NULL, NULL);
|
||||
|
||||
out:
|
||||
XFreeStringList (local_list);
|
||||
|
Reference in New Issue
Block a user