Skip to content

Commit 7bcf019

Browse files
authored
Merge branch 'master' into wayland_direct_scanout
2 parents c60db70 + 7453e8d commit 7bcf019

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1553
-579
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,28 @@ on:
1414
description: 'Start an SSH server on failure.'
1515
required: false
1616
default: false
17+
issue_comment:
18+
types: [created]
1719

1820
jobs:
1921
build:
22+
if: github.event_name != 'issue_comment'
2023
uses: linuxmint/github-actions/.github/workflows/do-builds.yml@master
2124
with:
2225
commit_id: master
2326
############################## Comma separated list - like 'linuxmint/xapp, linuxmint/cinnamon-desktop'
2427
dependencies: linuxmint/cinnamon-desktop
2528
##############################
29+
30+
# Generate test packages when /generate-test-packages is commented on a PR
31+
generate-test-packages:
32+
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
33+
uses: linuxmint/github-actions/.github/workflows/generate-test-packages.yml@master
34+
secrets: inherit
35+
with:
36+
comment_body: ${{ github.event.comment.body }}
37+
comment_user: ${{ github.event.comment.user.login }}
38+
comment_id: ${{ github.event.comment.id }}
39+
issue_number: ${{ github.event.issue.number }}
40+
############################## Comma separated list - like 'linuxmint/xapp, linuxmint/cinnamon-desktop'
41+
dependencies: linuxmint/cinnamon-desktop
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright (C) 2007,2008,2009,2010,2011 Intel Corporation.
3+
* Copyright (C) 2020 Red Hat Inc
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation; either
8+
* version 2 of the License, or (at your option) any later version.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#include "clutter-build-config.h"
20+
21+
#include "clutter-damage-history.h"
22+
23+
#define DAMAGE_HISTORY_LENGTH 0x10
24+
25+
struct _ClutterDamageHistory
26+
{
27+
cairo_region_t *damages[DAMAGE_HISTORY_LENGTH];
28+
int index;
29+
};
30+
31+
ClutterDamageHistory *
32+
clutter_damage_history_new (void)
33+
{
34+
ClutterDamageHistory *history;
35+
36+
history = g_new0 (ClutterDamageHistory, 1);
37+
38+
return history;
39+
}
40+
41+
void
42+
clutter_damage_history_free (ClutterDamageHistory *history)
43+
{
44+
int i;
45+
46+
for (i = 0; i < G_N_ELEMENTS (history->damages); i++)
47+
g_clear_pointer (&history->damages[i], cairo_region_destroy);
48+
49+
g_free (history);
50+
}
51+
52+
gboolean
53+
clutter_damage_history_is_age_valid (ClutterDamageHistory *history,
54+
int age)
55+
{
56+
if (age >= DAMAGE_HISTORY_LENGTH ||
57+
age < 1)
58+
return FALSE;
59+
60+
if (!clutter_damage_history_lookup (history, age))
61+
return FALSE;
62+
63+
return TRUE;
64+
}
65+
66+
void
67+
clutter_damage_history_record (ClutterDamageHistory *history,
68+
const cairo_region_t *damage)
69+
{
70+
g_clear_pointer (&history->damages[history->index], cairo_region_destroy);
71+
history->damages[history->index] = cairo_region_copy (damage);
72+
}
73+
74+
static inline int
75+
step_damage_index (int current,
76+
int diff)
77+
{
78+
return (current + diff) & (DAMAGE_HISTORY_LENGTH - 1);
79+
}
80+
81+
void
82+
clutter_damage_history_step (ClutterDamageHistory *history)
83+
{
84+
history->index = step_damage_index (history->index, 1);
85+
}
86+
87+
const cairo_region_t *
88+
clutter_damage_history_lookup (ClutterDamageHistory *history,
89+
int age)
90+
{
91+
return history->damages[step_damage_index (history->index, -age)];
92+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (C) 2007,2008,2009,2010,2011 Intel Corporation.
3+
* Copyright (C) 2020 Red Hat Inc
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation; either
8+
* version 2 of the License, or (at your option) any later version.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#ifndef CLUTTER_DAMAGE_HISTORY_H
20+
#define CLUTTER_DAMAGE_HISTORY_H
21+
22+
#include <cairo.h>
23+
#include <glib.h>
24+
25+
typedef struct _ClutterDamageHistory ClutterDamageHistory;
26+
27+
ClutterDamageHistory * clutter_damage_history_new (void);
28+
29+
void clutter_damage_history_free (ClutterDamageHistory *history);
30+
31+
gboolean clutter_damage_history_is_age_valid (ClutterDamageHistory *history,
32+
int age);
33+
34+
void clutter_damage_history_record (ClutterDamageHistory *history,
35+
const cairo_region_t *damage);
36+
37+
void clutter_damage_history_step (ClutterDamageHistory *history);
38+
39+
const cairo_region_t * clutter_damage_history_lookup (ClutterDamageHistory *history,
40+
int age);
41+
42+
#endif /* CLUTTER_DAMAGE_HISTORY_H */

clutter/clutter/clutter-enums.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,17 +853,18 @@ typedef enum /*< prefix=CLUTTER_DRAG >*/
853853

854854
/**
855855
* ClutterEventFlags:
856-
* @CLUTTER_EVENT_NONE: No flag set
856+
* @CLUTTER_EVENT_FLAG_NONE: No flag set
857857
* @CLUTTER_EVENT_FLAG_SYNTHETIC: Synthetic event
858+
* @CLUTTER_EVENT_FLAG_INPUT_METHOD: From an IM,
858859
* @CLUTTER_EVENT_FLAG_REPEATED: Auto-repeated event
859860
*
860861
* Flags for the #ClutterEvent
861862
*
862863
* Since: 0.6
863864
*/
864-
typedef enum /*< flags prefix=CLUTTER_EVENT >*/
865+
typedef enum /*< flags prefix=CLUTTER_EVENT_FLAG >*/
865866
{
866-
CLUTTER_EVENT_NONE = 0,
867+
CLUTTER_EVENT_FLAG_NONE = 0,
867868
CLUTTER_EVENT_FLAG_SYNTHETIC = 1 << 0,
868869
CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1,
869870
CLUTTER_EVENT_FLAG_REPEATED = 1 << 2

clutter/clutter/clutter-event.c

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ clutter_event_set_stage (ClutterEvent *event,
645645
ClutterEventFlags
646646
clutter_event_get_flags (const ClutterEvent *event)
647647
{
648-
g_return_val_if_fail (event != NULL, CLUTTER_EVENT_NONE);
648+
g_return_val_if_fail (event != NULL, CLUTTER_EVENT_FLAG_NONE);
649649

650650
return event->any.flags;
651651
}
@@ -2213,6 +2213,51 @@ clutter_event_get_gesture_motion_delta (const ClutterEvent *event,
22132213
}
22142214
}
22152215

2216+
/**
2217+
* clutter_event_get_gesture_motion_delta_unaccelerated:
2218+
* @event: A clutter touchpad gesture event
2219+
* @dx: (out) (allow-none): the unaccelerated displacement relative to the pointer
2220+
* position in the X axis, or %NULL
2221+
* @dy: (out) (allow-none): the unaccelerated displacement relative to the pointer
2222+
* position in the Y axis, or %NULL
2223+
*
2224+
* Returns the unaccelerated gesture motion deltas relative to the current
2225+
* pointer position. Unlike clutter_event_get_gesture_motion_delta(),
2226+
* pointer acceleration is ignored.
2227+
**/
2228+
void
2229+
clutter_event_get_gesture_motion_delta_unaccelerated (const ClutterEvent *event,
2230+
gdouble *dx,
2231+
gdouble *dy)
2232+
{
2233+
g_return_if_fail (event != NULL);
2234+
g_return_if_fail (event->type == CLUTTER_TOUCHPAD_PINCH ||
2235+
event->type == CLUTTER_TOUCHPAD_SWIPE ||
2236+
event->type == CLUTTER_TOUCHPAD_HOLD);
2237+
2238+
if (event->type == CLUTTER_TOUCHPAD_PINCH)
2239+
{
2240+
if (dx)
2241+
*dx = event->touchpad_pinch.dx_unaccel;
2242+
if (dy)
2243+
*dy = event->touchpad_pinch.dy_unaccel;
2244+
}
2245+
else if (event->type == CLUTTER_TOUCHPAD_SWIPE)
2246+
{
2247+
if (dx)
2248+
*dx = event->touchpad_swipe.dx_unaccel;
2249+
if (dy)
2250+
*dy = event->touchpad_swipe.dy_unaccel;
2251+
}
2252+
else if (event->type == CLUTTER_TOUCHPAD_HOLD)
2253+
{
2254+
if (dx)
2255+
*dx = 0;
2256+
if (dy)
2257+
*dy = 0;
2258+
}
2259+
}
2260+
22162261
/**
22172262
* clutter_event_get_scroll_source:
22182263
* @event: an scroll event

clutter/clutter/clutter-event.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ struct _ClutterTouchpadPinchEvent
461461
gfloat y;
462462
gfloat dx;
463463
gfloat dy;
464+
gfloat dx_unaccel;
465+
gfloat dy_unaccel;
464466
gfloat angle_delta;
465467
gfloat scale;
466468
guint n_fingers;
@@ -499,6 +501,8 @@ struct _ClutterTouchpadSwipeEvent
499501
gfloat y;
500502
gfloat dx;
501503
gfloat dy;
504+
gfloat dx_unaccel;
505+
gfloat dy_unaccel;
502506
};
503507

504508
/**
@@ -840,6 +844,11 @@ void clutter_event_get_gesture_motion_delta (const Clut
840844
gdouble *dx,
841845
gdouble *dy);
842846

847+
CLUTTER_EXPORT
848+
void clutter_event_get_gesture_motion_delta_unaccelerated (const ClutterEvent *event,
849+
gdouble *dx,
850+
gdouble *dy);
851+
843852
CLUTTER_EXPORT
844853
ClutterScrollSource clutter_event_get_scroll_source (const ClutterEvent *event);
845854

clutter/clutter/clutter-input-pointer-a11y.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ update_dwell_click_type (ClutterInputDevice *device)
305305

306306
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
307307

308+
if (settings.dwell_click_mode_lock)
309+
return;
310+
308311
dwell_click_type = settings.dwell_click_type;
309312
switch (dwell_click_type)
310313
{

clutter/clutter/clutter-seat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ typedef struct _ClutterPointerA11ySettings
7474
gint secondary_click_delay;
7575
gint dwell_delay;
7676
gint dwell_threshold;
77+
gboolean dwell_click_mode_lock;
7778
} ClutterPointerA11ySettings;
7879

7980
/**

clutter/clutter/clutter-stage-view-private.h

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,28 @@
2020

2121
#include "clutter/clutter-stage-view.h"
2222

23-
void clutter_stage_view_after_paint (ClutterStageView *view);
23+
void clutter_stage_view_after_paint (ClutterStageView *view,
24+
cairo_region_t *redraw_clip);
25+
26+
void clutter_stage_view_before_swap_buffer (ClutterStageView *view,
27+
const cairo_region_t *swap_region);
2428

2529
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
2630

27-
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
28-
gboolean dirty);
31+
void clutter_stage_view_invalidate_viewport (ClutterStageView *view);
32+
33+
void clutter_stage_view_set_viewport (ClutterStageView *view,
34+
float x,
35+
float y,
36+
float width,
37+
float height);
2938

3039
gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
3140

32-
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
33-
gboolean dirty);
41+
void clutter_stage_view_invalidate_projection (ClutterStageView *view);
42+
43+
void clutter_stage_view_set_projection (ClutterStageView *view,
44+
const CoglMatrix *matrix);
3445

3546
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
3647
const cairo_rectangle_int_t *clip);
@@ -45,4 +56,10 @@ cairo_region_t * clutter_stage_view_take_redraw_clip (ClutterStageView *view);
4556

4657
CoglScanout * clutter_stage_view_take_scanout (ClutterStageView *view);
4758

59+
void clutter_stage_view_transform_rect_to_onscreen (ClutterStageView *view,
60+
const cairo_rectangle_int_t *src_rect,
61+
int dst_width,
62+
int dst_height,
63+
cairo_rectangle_int_t *dst_rect);
64+
4865
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */

0 commit comments

Comments
 (0)