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
86a7b5bd
Unverified
Commit
86a7b5bd
authored
Mar 02, 2025
by
Erik Reider
Committed by
GitHub
Mar 02, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added layer-shell-cover-screen option to fix animations in Hyprland (#520)
* Added layer-shell-cover-screen option to fix animations in Hyprland * Fixed linting issue
parent
dc7cd1af
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
5 deletions
+55
-5
config.json.in
src/config.json.in
+1
-0
configModel.vala
src/configModel/configModel.vala
+6
-0
configSchema.json
src/configSchema.json
+5
-0
controlCenter.vala
src/controlCenter/controlCenter.vala
+40
-4
swayncDaemon.vala
src/swayncDaemon/swayncDaemon.vala
+3
-1
No files found.
src/config.json.in
View file @
86a7b5bd
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
"layer": "overlay",
"layer": "overlay",
"control-center-layer": "top",
"control-center-layer": "top",
"layer-shell": true,
"layer-shell": true,
"layer-shell-cover-screen": true,
"cssPriority": "application",
"cssPriority": "application",
"control-center-margin-top": 0,
"control-center-margin-top": 0,
"control-center-margin-bottom": 0,
"control-center-margin-bottom": 0,
...
...
src/configModel/configModel.vala
View file @
86a7b5bd
...
@@ -335,6 +335,12 @@ namespace SwayNotificationCenter {
...
@@ -335,6 +335,12 @@ namespace SwayNotificationCenter {
*/
*/
public
bool
layer_shell
{
get
;
set
;
default
=
true
;
}
public
bool
layer_shell
{
get
;
set
;
default
=
true
;
}
/**
* Wether or not the windows should cover the whole screen when
* layer-shell is used.
*/
public
bool
layer_shell_cover_screen
{
get
;
set
;
default
=
true
;
}
/** The CSS loading priority */
/** The CSS loading priority */
public
CssPriority
cssPriority
{
// vala-lint=naming-convention
public
CssPriority
cssPriority
{
// vala-lint=naming-convention
get
;
set
;
default
=
CssPriority
.
APPLICATION
;
get
;
set
;
default
=
CssPriority
.
APPLICATION
;
...
...
src/configSchema.json
View file @
86a7b5bd
...
@@ -25,6 +25,11 @@
...
@@ -25,6 +25,11 @@
"description"
:
"Wether or not the windows should be opened as layer-shell surfaces. Note: Requires swaync restart to apply"
,
"description"
:
"Wether or not the windows should be opened as layer-shell surfaces. Note: Requires swaync restart to apply"
,
"default"
:
true
"default"
:
true
},
},
"layer-shell-cover-screen"
:
{
"type"
:
"boolean"
,
"description"
:
"Wether or not the windows should cover the whole screen when layer-shell is used. Fixes animations in compositors like Hyprland."
,
"default"
:
true
},
"cssPriority"
:
{
"cssPriority"
:
{
"type"
:
"string"
,
"type"
:
"string"
,
"description"
:
"Which GTK priority to use when loading the default and user CSS files. Pick
\"
user
\"
to override XDG_CONFIG_HOME/gtk-3.0/gtk.css"
,
"description"
:
"Which GTK priority to use when loading the default and user CSS files. Pick
\"
user
\"
to override XDG_CONFIG_HOME/gtk-3.0/gtk.css"
,
...
...
src/controlCenter/controlCenter.vala
View file @
86a7b5bd
...
@@ -394,6 +394,11 @@ namespace SwayNotificationCenter {
...
@@ -394,6 +394,11 @@ namespace SwayNotificationCenter {
/** Resets the UI positions */
/** Resets the UI positions */
private
void
set_anchor
()
{
private
void
set_anchor
()
{
PositionX
pos_x
=
ConfigModel
.
instance
.
control_center_positionX
;
if
(
pos_x
==
PositionX
.
NONE
)
pos_x
=
ConfigModel
.
instance
.
positionX
;
PositionY
pos_y
=
ConfigModel
.
instance
.
control_center_positionY
;
if
(
pos_y
==
PositionY
.
NONE
)
pos_y
=
ConfigModel
.
instance
.
positionY
;
if
(
swaync_daemon
.
use_layer_shell
)
{
if
(
swaync_daemon
.
use_layer_shell
)
{
// Set the exlusive zone
// Set the exlusive zone
int
exclusive_zone
=
ConfigModel
.
instance
.
control_center_exclusive_zone
?
0
:
100
;
int
exclusive_zone
=
ConfigModel
.
instance
.
control_center_exclusive_zone
?
0
:
100
;
...
@@ -423,6 +428,41 @@ namespace SwayNotificationCenter {
...
@@ -423,6 +428,41 @@ namespace SwayNotificationCenter {
break
;
break
;
}
}
GtkLayerShell
.
set_layer
(
this
,
layer
);
GtkLayerShell
.
set_layer
(
this
,
layer
);
// Set whether the control center should cover the whole screen or not
bool
cover_screen
=
ConfigModel
.
instance
.
layer_shell_cover_screen
;
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
TOP
,
cover_screen
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
cover_screen
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
cover_screen
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
BOTTOM
,
cover_screen
);
if
(!
ConfigModel
.
instance
.
layer_shell_cover_screen
)
{
switch
(
pos_x
)
{
case
PositionX
.
LEFT
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
true
);
break
;
case
PositionX
.
CENTER
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
true
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
true
);
break
;
default
:
case
PositionX
.
RIGHT
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
true
);
break
;
}
switch
(
pos_y
)
{
default
:
case
PositionY
.
TOP
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
TOP
,
true
);
break
;
case
PositionY
.
CENTER
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
TOP
,
true
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
BOTTOM
,
true
);
break
;
case
PositionY
.
BOTTOM
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
BOTTOM
,
true
);
break
;
}
}
}
}
// Set the box margins
// Set the box margins
...
@@ -433,8 +473,6 @@ namespace SwayNotificationCenter {
...
@@ -433,8 +473,6 @@ namespace SwayNotificationCenter {
// Anchor box to north/south edges as needed
// Anchor box to north/south edges as needed
Gtk
.
Align
align_x
=
Gtk
.
Align
.
END
;
Gtk
.
Align
align_x
=
Gtk
.
Align
.
END
;
PositionX
pos_x
=
ConfigModel
.
instance
.
control_center_positionX
;
if
(
pos_x
==
PositionX
.
NONE
)
pos_x
=
ConfigModel
.
instance
.
positionX
;
switch
(
pos_x
)
{
switch
(
pos_x
)
{
case
PositionX
.
LEFT
:
case
PositionX
.
LEFT
:
align_x
=
Gtk
.
Align
.
START
;
align_x
=
Gtk
.
Align
.
START
;
...
@@ -448,8 +486,6 @@ namespace SwayNotificationCenter {
...
@@ -448,8 +486,6 @@ namespace SwayNotificationCenter {
break
;
break
;
}
}
Gtk
.
Align
align_y
=
Gtk
.
Align
.
START
;
Gtk
.
Align
align_y
=
Gtk
.
Align
.
START
;
PositionY
pos_y
=
ConfigModel
.
instance
.
control_center_positionY
;
if
(
pos_y
==
PositionY
.
NONE
)
pos_y
=
ConfigModel
.
instance
.
positionY
;
switch
(
pos_y
)
{
switch
(
pos_y
)
{
default
:
default
:
case
PositionY
.
TOP
:
case
PositionY
.
TOP
:
...
...
src/swayncDaemon/swayncDaemon.vala
View file @
86a7b5bd
...
@@ -129,7 +129,9 @@ namespace SwayNotificationCenter {
...
@@ -129,7 +129,9 @@ namespace SwayNotificationCenter {
[
DBus
(
visible
=
false
)]
[
DBus
(
visible
=
false
)]
public
void
show_blank_windows
(
Gdk
.
Monitor
?
monitor
)
{
public
void
show_blank_windows
(
Gdk
.
Monitor
?
monitor
)
{
if
(!
use_layer_shell
)
return
;
if
(!
use_layer_shell
||
!
ConfigModel
.
instance
.
layer_shell_cover_screen
)
{
return
;
}
foreach
(
unowned
BlankWindow
win
in
blank_windows
.
data
)
{
foreach
(
unowned
BlankWindow
win
in
blank_windows
.
data
)
{
if
(
win
.
monitor
!=
monitor
)
win
.
show
();
if
(
win
.
monitor
!=
monitor
)
win
.
show
();
}
}
...
...
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