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
1751b630
Verified
Commit
1751b630
authored
Mar 21, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
functions: guard against division by zero in scale_texture
parent
6afe8fa0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
functions.vala
src/functions.vala
+7
-1
No files found.
src/functions.vala
View file @
1751b630
...
...
@@ -223,10 +223,16 @@ namespace XimperShellNotificationCenter {
int
buffer_height
,
int
img_scale
,
Gtk
.
Snapshot
snapshot
)
{
if
(
img_scale
<=
0
||
buffer_width
<=
0
||
buffer_height
<=
0
)
{
return
;
}
int
width
=
texture
.
width
/
img_scale
;
int
height
=
texture
.
height
/
img_scale
;
if
(
width
<=
0
||
height
<=
0
)
{
return
;
}
double
window_ratio
=
(
double
)
buffer_width
/
buffer_height
;
double
bg_ratio
=
width
/
height
;
double
bg_ratio
=
(
double
)
width
/
height
;
snapshot
.
save
();
if
(
window_ratio
>
bg_ratio
)
{
// Taller wallpaper than monitor
double
scale
=
(
double
)
buffer_width
/
width
;
...
...
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