Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-notification-center
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-notification-center
Commits
97e411dd
Commit
97e411dd
authored
Oct 18, 2025
by
Erik Reider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update floating notification input region more frequently
parent
c69bafa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
42 deletions
+53
-42
notificationWindow.vala
src/notificationWindow/notificationWindow.vala
+53
-42
No files found.
src/notificationWindow/notificationWindow.vala
View file @
97e411dd
...
...
@@ -85,47 +85,7 @@ namespace SwayNotificationCenter {
base
.
size_allocate
(
w
,
h
,
baseline
);
// Set the input region to only be the size of the ScrolledWindow
Graphene
.
Rect
bounds
;
scrolled_window
.
compute_bounds
(
this
,
out
bounds
);
if
(!
bounds
.
equal
(
this
.
scrolled_window_bounds
))
{
this
.
scrolled_window_bounds
=
bounds
;
unowned
Gdk
.
Surface
?
surface
=
window
.
get_surface
();
if
(
surface
==
null
)
{
return
;
}
Cairo
.
Region
region
=
new
Cairo
.
Region
();
foreach
(
AnimatedListItem
item
in
list
.
visible_children
)
{
if
(
item
.
destroying
)
{
continue
;
}
Graphene
.
Rect
out_bounds
;
item
.
compute_bounds
(
this
,
out
out_bounds
);
Cairo
.
RectangleInt
item_rect
=
Cairo
.
RectangleInt
()
{
x
=
(
int
)
out_bounds
.
get_x
(),
y
=
(
int
)
out_bounds
.
get_y
(),
width
=
(
int
)
out_bounds
.
get_width
(),
height
=
(
int
)
out_bounds
.
get_height
(),
};
region
.
union_rectangle
(
item_rect
);
}
// The input region should only cover each preview widget
Graphene
.
Rect
scrollbar_bounds
;
unowned
Gtk
.
Widget
scrollbar
=
scrolled_window
.
get_vscrollbar
();
if
(
scrollbar
.
should_layout
())
{
scrollbar
.
compute_bounds
(
this
,
out
scrollbar_bounds
);
Cairo
.
RectangleInt
rect
=
Cairo
.
RectangleInt
()
{
x
=
(
int
)
scrollbar_bounds
.
get_x
(),
y
=
(
int
)
scrollbar_bounds
.
get_y
(),
width
=
(
int
)
scrollbar_bounds
.
get_width
(),
height
=
(
int
)
scrollbar_bounds
.
get_height
(),
};
region
.
union_rectangle
(
rect
);
}
surface
.
set_input_region
(
region
);
}
set_input_region
();
}
protected
override
void
snapshot
(
Gtk
.
Snapshot
snapshot
)
{
...
...
@@ -213,6 +173,50 @@ namespace SwayNotificationCenter {
set_monitor
(
Functions
.
try_get_monitor
(
monitor_name
));
}
private
void
set_input_region
()
{
Graphene
.
Rect
bounds
;
scrolled_window
.
compute_bounds
(
this
,
out
bounds
);
if
(!
bounds
.
equal
(
this
.
scrolled_window_bounds
))
{
this
.
scrolled_window_bounds
=
bounds
;
unowned
Gdk
.
Surface
?
surface
=
window
.
get_surface
();
if
(
surface
==
null
)
{
return
;
}
Cairo
.
Region
region
=
new
Cairo
.
Region
();
foreach
(
AnimatedListItem
item
in
list
.
visible_children
)
{
if
(
item
.
destroying
)
{
continue
;
}
Graphene
.
Rect
out_bounds
;
item
.
compute_bounds
(
this
,
out
out_bounds
);
Cairo
.
RectangleInt
item_rect
=
Cairo
.
RectangleInt
()
{
x
=
(
int
)
out_bounds
.
get_x
(),
y
=
(
int
)
out_bounds
.
get_y
(),
width
=
(
int
)
out_bounds
.
get_width
(),
height
=
(
int
)
out_bounds
.
get_height
(),
};
region
.
union_rectangle
(
item_rect
);
}
// The input region should only cover each preview widget
Graphene
.
Rect
scrollbar_bounds
;
unowned
Gtk
.
Widget
scrollbar
=
scrolled_window
.
get_vscrollbar
();
if
(
scrollbar
.
should_layout
())
{
scrollbar
.
compute_bounds
(
this
,
out
scrollbar_bounds
);
Cairo
.
RectangleInt
rect
=
Cairo
.
RectangleInt
()
{
x
=
(
int
)
scrollbar_bounds
.
get_x
(),
y
=
(
int
)
scrollbar_bounds
.
get_y
(),
width
=
(
int
)
scrollbar_bounds
.
get_width
(),
height
=
(
int
)
scrollbar_bounds
.
get_height
(),
};
region
.
union_rectangle
(
rect
);
}
surface
.
set_input_region
(
region
);
}
}
public
void
change_visibility
(
bool
value
)
{
if
(!
value
)
{
close_all_notifications
();
...
...
@@ -269,7 +273,9 @@ namespace SwayNotificationCenter {
Idle
.
add_once
(()
=>
{
close
();
});
return
;
}
set_input_region
();
});
}
}
...
...
@@ -298,7 +304,10 @@ namespace SwayNotificationCenter {
}
show
();
list
.
append
.
begin
(
noti
);
list
.
append
.
begin
(
noti
,
(
obj
,
res
)
=>
{
return_if_fail
(
list
.
append
.
end
(
res
)
!=
null
);
set_input_region
();
});
}
public
void
close_notification
(
uint32
id
,
bool
dismiss
)
{
...
...
@@ -359,6 +368,8 @@ namespace SwayNotificationCenter {
debug
(
"Setting monitor for ControlCenter: %s"
,
Functions
.
monitor_to_string
(
monitor
));
NotificationWindow
.
monitor_name
=
monitor
==
null
?
null
:
monitor
.
connector
;
GtkLayerShell
.
set_monitor
(
this
,
monitor
);
set_input_region
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment