mirror of
https://github.com/elementary/gala.git
synced 2024-09-11 15:15:39 +03:00
pip: Don't include shadows by using window's frame-rect (#74)
This commit is contained in:
parent
cd28b8d398
commit
fb8364ca0c
@ -96,6 +96,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor
|
||||
if (container_clip == null) {
|
||||
window_actor.notify["allocation"].connect (on_allocation_changed);
|
||||
container.set_position (CONTAINER_MARGIN, CONTAINER_MARGIN);
|
||||
update_clone_clip ();
|
||||
}
|
||||
|
||||
update_size ();
|
||||
@ -246,6 +247,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor
|
||||
|
||||
private void on_allocation_changed ()
|
||||
{
|
||||
update_clone_clip ();
|
||||
update_size ();
|
||||
reposition_resize_button ();
|
||||
reposition_resize_handle ();
|
||||
@ -274,6 +276,18 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor
|
||||
}
|
||||
}
|
||||
|
||||
private void update_clone_clip ()
|
||||
{
|
||||
var rect = window_actor.get_meta_window ().get_frame_rect ();
|
||||
|
||||
float x_offset = rect.x - window_actor.x;
|
||||
float y_offset = rect.y - window_actor.y;
|
||||
clone.set_clip (x_offset, y_offset, rect.width, rect.height);
|
||||
clone.set_position (-x_offset, -y_offset);
|
||||
|
||||
container.set_size (rect.width, rect.height);
|
||||
}
|
||||
|
||||
private void update_container_scale ()
|
||||
{
|
||||
float src_width;
|
||||
@ -364,9 +378,14 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor
|
||||
if (container_clip != null) {
|
||||
width = container_clip.get_width ();
|
||||
height = container_clip.get_height ();
|
||||
} else if (clone.has_clip) {
|
||||
float clone_clip_width = 0.0f, clone_clip_height = 0.0f;
|
||||
clone.get_clip (null, null, out clone_clip_width, out clone_clip_height);
|
||||
width = clone_clip_width;
|
||||
height = clone_clip_height;
|
||||
} else {
|
||||
width = window_actor.width;
|
||||
height = window_actor.height;
|
||||
width = clone.width;
|
||||
height = clone.height;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user