Skip to content

Commit 04c5f7d

Browse files
authored
Merge branch 'main' into lenemter/hide-actor-when-destroying
2 parents b2e5e71 + 2642214 commit 04c5f7d

File tree

5 files changed

+16
-52
lines changed

5 files changed

+16
-52
lines changed

daemon/MonitorLabel.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
var provider = new Gtk.CssProvider ();
3232
try {
3333
provider.load_from_string (COLORED_STYLE_CSS.printf (title, info.background_color, info.text_color));
34-
get_style_context ().add_class (title);
35-
get_style_context ().add_class ("monitor-label");
34+
add_css_class (title);
35+
add_css_class ("monitor-label");
3636

3737
Gtk.StyleContext.add_provider_for_display (
3838
Gdk.Display.get_default (),

lib/Gestures/GestureSettings.vala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,6 @@ private class Gala.GestureSettings : Object {
3434
: touchpad_settings.get_boolean ("natural-scroll");
3535
}
3636

37-
public Meta.MotionDirection? get_direction (Gesture gesture) {
38-
switch (gesture.direction) {
39-
case GestureDirection.UP:
40-
return Meta.MotionDirection.UP;
41-
case GestureDirection.DOWN:
42-
return Meta.MotionDirection.DOWN;
43-
case GestureDirection.LEFT:
44-
return Meta.MotionDirection.LEFT;
45-
case GestureDirection.RIGHT:
46-
return Meta.MotionDirection.RIGHT;
47-
default:
48-
return null;
49-
}
50-
}
51-
5237
public Meta.MotionDirection? get_natural_scroll_direction (Gesture gesture) {
5338
bool natural_scroll = is_natural_scroll_enabled (gesture.performed_on_device_type);
5439

lib/Gestures/ScrollBackend.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private class Gala.ScrollBackend : Object, GestureBackend {
7373
// Scroll events apply the natural scroll preferences out of the box
7474
// Standardize them so the direction matches the physical direction of the gesture and the
7575
// GestureTracker user can decide if it wants to follow natural scroll settings or not
76-
bool natural_scroll = settings.is_natural_scroll_enabled (Clutter.InputDeviceType.TOUCHPAD_DEVICE);
76+
bool natural_scroll = GestureSettings.is_natural_scroll_enabled (Clutter.InputDeviceType.TOUCHPAD_DEVICE);
7777
if (natural_scroll) {
7878
x *= -1;
7979
y *= -1;

lib/Gestures/ToucheggBackend.vala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,6 @@ private class Gala.ToucheggBackend : Object, GestureBackend {
150150
new Thread<void> (null, (owned) run);
151151
}
152152

153-
public void stop () {
154-
try {
155-
reconnection_attempts = MAX_RECONNECTION_ATTEMPTS;
156-
157-
if (!connection.closed) {
158-
connection.close_sync ();
159-
}
160-
} catch (Error e) {
161-
// Ignore this error, the process is being killed as this point
162-
}
163-
}
164-
165153
[CCode (instance_pos = -1)]
166154
private void on_new_message (DBusConnection connection, string? sender_name, string object_path,
167155
string interface_name, string signal_name, Variant parameters) {

src/WindowManager.vala

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,59 +1079,50 @@ namespace Gala {
10791079
return;
10801080
}
10811081

1082-
var duration = AnimationDuration.HIDE;
1083-
10841082
kill_window_effects (actor);
10851083
minimizing.add (actor);
10861084

1087-
int width, height;
1088-
get_display ().get_size (out width, out height);
1089-
10901085
Mtk.Rectangle icon = {};
10911086
if (actor.get_meta_window ().get_icon_geometry (out icon)) {
10921087
// Fix icon position and size according to ui scaling factor.
1093-
float ui_scale = get_display ().get_monitor_scale (get_display ().get_monitor_index_for_rect (icon));
1088+
var ui_scale = get_display ().get_monitor_scale (get_display ().get_monitor_index_for_rect (icon));
10941089
icon.x = Utils.scale_to_int (icon.x, ui_scale);
10951090
icon.y = Utils.scale_to_int (icon.y, ui_scale);
10961091
icon.width = Utils.scale_to_int (icon.width, ui_scale);
10971092
icon.height = Utils.scale_to_int (icon.height, ui_scale);
10981093

1099-
float scale_x = (float)icon.width / actor.width;
1100-
float scale_y = (float)icon.height / actor.height;
1101-
float anchor_x = (float)(actor.x - icon.x) / (icon.width - actor.width);
1102-
float anchor_y = (float)(actor.y - icon.y) / (icon.height - actor.height);
1103-
actor.set_pivot_point (anchor_x, anchor_y);
1094+
actor.set_pivot_point (
1095+
(actor.x - icon.x) / (icon.width - actor.width),
1096+
(actor.y - icon.y) / (icon.height - actor.height)
1097+
);
11041098

11051099
actor.save_easing_state ();
11061100
actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_EXPO);
1107-
actor.set_easing_duration (duration);
1108-
actor.set_scale (scale_x, scale_y);
1109-
actor.opacity = 0U;
1101+
actor.set_easing_duration (AnimationDuration.HIDE);
1102+
actor.set_scale (icon.width / actor.width, icon.height / actor.height);
1103+
actor.opacity = 0;
11101104
actor.restore_easing_state ();
11111105

1112-
ulong minimize_handler_id = 0UL;
1106+
ulong minimize_handler_id = 0;
11131107
minimize_handler_id = actor.transitions_completed.connect (() => {
11141108
actor.disconnect (minimize_handler_id);
11151109
minimize_completed (actor);
11161110
minimizing.remove (actor);
11171111
});
1118-
11191112
} else {
11201113
actor.set_pivot_point (0.5f, 1.0f);
11211114

11221115
actor.save_easing_state ();
11231116
actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_EXPO);
1124-
actor.set_easing_duration (duration);
1125-
actor.set_scale (0.0f, 0.0f);
1126-
actor.opacity = 0U;
1117+
actor.set_easing_duration (AnimationDuration.HIDE);
1118+
actor.set_scale (0.0, 0.0);
1119+
actor.opacity = 0;
11271120
actor.restore_easing_state ();
11281121

1129-
ulong minimize_handler_id = 0UL;
1122+
ulong minimize_handler_id = 0;
11301123
minimize_handler_id = actor.transitions_completed.connect (() => {
11311124
actor.disconnect (minimize_handler_id);
11321125
actor.set_pivot_point (0.0f, 0.0f);
1133-
actor.set_scale (1.0f, 1.0f);
1134-
actor.opacity = 255U;
11351126
minimize_completed (actor);
11361127
minimizing.remove (actor);
11371128
});

0 commit comments

Comments
 (0)