Skip to content

Commit

Permalink
PIP: Fix log spam (#1521)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter committed Feb 12, 2023
1 parent c69171b commit 37c3e88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
1 change: 1 addition & 0 deletions data/gala.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</description>
<issues>
<issue url="https://github.com/elementary/gala/issues/24">Workspace switching shortcuts don't work in Multitasking View</issue>
<issue url="https://github.com/elementary/gala/issues/1478">PiP: Log spam on elementary OS 7.0</issue>
</issues>
</release>

Expand Down
41 changes: 14 additions & 27 deletions plugins/pip/PopupWindow.vala
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
//
// Copyright (C) 2017 Adam Bieńkowski
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
/*
* Copyright 2017 Adam Bieńkowski
* Copyright 2023 elementary, Inc. <https://elementary.io>
* SPDX-License-Identifier: GPL-3.0-or-later
*/

public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
private int button_size;
Expand Down Expand Up @@ -182,7 +171,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
resize_button.set_easing_duration (300);
resize_button.opacity = 255;
resize_button.set_easing_duration (0);
return true;
return Gdk.EVENT_PROPAGATE;
}

public override bool leave_event (Clutter.CrossingEvent event) {
Expand All @@ -191,7 +180,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
resize_button.set_easing_duration (300);
resize_button.opacity = 0;
resize_button.set_easing_duration (0);
return true;
return Gdk.EVENT_PROPAGATE;
}

public void set_container_clip (Graphene.Rect? container_clip) {
Expand All @@ -212,7 +201,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {

private bool on_resize_button_press (Clutter.ButtonEvent event) {
if (resizing || event.button != 1) {
return false;
return Gdk.EVENT_STOP;
}

resizing = true;
Expand All @@ -230,12 +219,12 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
resize_button.get_stage ().captured_event.connect (on_resize_event);
#endif

return true;
return Gdk.EVENT_PROPAGATE;
}

private bool on_resize_event (Clutter.Event event) {
if (!resizing) {
return false;
return Gdk.EVENT_STOP;
}

switch (event.get_type ()) {
Expand Down Expand Up @@ -268,17 +257,17 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
break;
case Clutter.EventType.LEAVE:
case Clutter.EventType.ENTER:
return true;
return Gdk.EVENT_PROPAGATE;
default:
break;
}

return false;
return Gdk.EVENT_STOP;
}

private bool stop_resizing () {
private void stop_resizing () {
if (!resizing) {
return false;
return;
}

#if HAS_MUTTER42
Expand All @@ -295,8 +284,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
resizing = false;

update_screen_position ();

return true;
}

private void on_allocation_changed () {
Expand Down

0 comments on commit 37c3e88

Please sign in to comment.