mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 19:10:43 -05:00
cursor-renderer-native: take rotation into account
Rotating an output would show duplicate cursors when the pointer is located over an area which would be within the output if not rotated. Make sure to swap the width/height of the output when rotated. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/85
This commit is contained in:
parent
6e415353e3
commit
ebff7fd7f4
@ -291,9 +291,11 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
|
|||||||
data->in_cursor_renderer_native;
|
data->in_cursor_renderer_native;
|
||||||
MetaCursorRendererNativePrivate *priv =
|
MetaCursorRendererNativePrivate *priv =
|
||||||
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
|
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
|
||||||
|
MetaMonitorTransform transform;
|
||||||
ClutterRect scaled_crtc_rect;
|
ClutterRect scaled_crtc_rect;
|
||||||
float scale;
|
float scale;
|
||||||
int crtc_x, crtc_y;
|
int crtc_x, crtc_y;
|
||||||
|
int crtc_width, crtc_height;
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_is_stage_views_scaled ())
|
||||||
scale = meta_logical_monitor_get_scale (data->in_logical_monitor);
|
scale = meta_logical_monitor_get_scale (data->in_logical_monitor);
|
||||||
@ -305,14 +307,26 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
|
|||||||
META_MONITOR_TRANSFORM_NORMAL,
|
META_MONITOR_TRANSFORM_NORMAL,
|
||||||
&crtc_x, &crtc_y);
|
&crtc_x, &crtc_y);
|
||||||
|
|
||||||
|
transform = meta_logical_monitor_get_transform (data->in_logical_monitor);
|
||||||
|
if (meta_monitor_transform_is_rotated (transform))
|
||||||
|
{
|
||||||
|
crtc_width = monitor_crtc_mode->crtc_mode->height;
|
||||||
|
crtc_height = monitor_crtc_mode->crtc_mode->width;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
crtc_width = monitor_crtc_mode->crtc_mode->width;
|
||||||
|
crtc_height = monitor_crtc_mode->crtc_mode->height;
|
||||||
|
}
|
||||||
|
|
||||||
scaled_crtc_rect = (ClutterRect) {
|
scaled_crtc_rect = (ClutterRect) {
|
||||||
.origin = {
|
.origin = {
|
||||||
.x = crtc_x / scale,
|
.x = crtc_x / scale,
|
||||||
.y = crtc_y / scale
|
.y = crtc_y / scale
|
||||||
},
|
},
|
||||||
.size = {
|
.size = {
|
||||||
.width = monitor_crtc_mode->crtc_mode->width / scale,
|
.width = crtc_width / scale,
|
||||||
.height = monitor_crtc_mode->crtc_mode->height / scale
|
.height = crtc_height / scale
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user