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
9133a765
Unverified
Commit
9133a765
authored
Aug 20, 2022
by
Erik Reider
Committed by
GitHub
Aug 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All notification urgencies can now use 0 as timeout to not expire (#158)
parent
3bc2b5e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
23 deletions
+22
-23
configModel.vala
src/configModel/configModel.vala
+14
-14
notification.vala
src/notification/notification.vala
+8
-9
No files found.
src/configModel/configModel.vala
View file @
9133a765
...
...
@@ -287,7 +287,7 @@ namespace SwayNotificationCenter {
return
_timeout
;
}
set
{
_timeout
=
value
<
1
?
TIMEOUT_DEFAULT
:
value
;
_timeout
=
value
<
0
?
TIMEOUT_DEFAULT
:
value
;
}
}
...
...
@@ -299,19 +299,7 @@ namespace SwayNotificationCenter {
return
_timeout_low
;
}
set
{
_timeout_low
=
value
<
1
?
TIMEOUT_LOW_DEFAULT
:
value
;
}
}
/** The transition time for all animations */
private
const
int
TRANSITION_TIME_DEFAULT
=
200
;
private
int
_transition_time
=
TRANSITION_TIME_DEFAULT
;
public
int
transition_time
{
get
{
return
_transition_time
;
}
set
{
_transition_time
=
value
<
0
?
TRANSITION_TIME_DEFAULT
:
value
;
_timeout_low
=
value
<
0
?
TIMEOUT_LOW_DEFAULT
:
value
;
}
}
...
...
@@ -327,6 +315,18 @@ namespace SwayNotificationCenter {
}
}
/** The transition time for all animations */
private
const
int
TRANSITION_TIME_DEFAULT
=
200
;
private
int
_transition_time
=
TRANSITION_TIME_DEFAULT
;
public
int
transition_time
{
get
{
return
_transition_time
;
}
set
{
_transition_time
=
value
<
0
?
TRANSITION_TIME_DEFAULT
:
value
;
}
}
/*
* Specifies if the control center should use keyboard shortcuts
* and block keyboard input for other applications while open
...
...
src/notification/notification.vala
View file @
9133a765
...
...
@@ -474,19 +474,18 @@ namespace SwayNotificationCenter {
timeout
=
timeout_delay
*
1000
;
break
;
case
UrgencyLevels
.
CRITICAL
:
if
(
timeout_critical_delay
==
0
)
{
return
;
}
// Critical notifications should not automatically expire.
// Ignores the notifications expire_timeout.
if
(
timeout_critical_delay
==
0
)
return
;
timeout
=
timeout_critical_delay
*
1000
;
break
;
}
uint
ms
=
param
.
expire_timeout
>
0
?
param
.
expire_timeout
:
timeout
;
if
(
ms
!=
0
)
{
timeout_id
=
Timeout
.
add
(
ms
,
()
=>
{
close_notification
(
true
);
return
GLib
.
Source
.
REMOVE
;
});
}
if
(
ms
<=
0
)
return
;
timeout_id
=
Timeout
.
add
(
ms
,
()
=>
{
close_notification
(
true
);
return
GLib
.
Source
.
REMOVE
;
});
}
public
void
remove_noti_timeout
()
{
...
...
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