-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add blur, shadow, and corner radius to layer-shell surfaces (#144)
Co-authored-by: Will McKinnon <contact@willmckinnon.com>
- Loading branch information
1 parent
6707842
commit 415e072
Showing
22 changed files
with
456 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <stdbool.h> | ||
#include "sway/layers.h" | ||
#include "sway/config.h" | ||
|
||
struct layer_criteria { | ||
char *namespace; | ||
char *cmdlist; | ||
}; | ||
|
||
void layer_criteria_destroy(struct layer_criteria *criteria); | ||
|
||
bool layer_criteria_is_equal(struct layer_criteria *a, struct layer_criteria *b); | ||
|
||
bool layer_criteria_already_exists(struct layer_criteria *criteria); | ||
|
||
// Gathers all of the matching criterias for a specified `sway_layer_surface` | ||
list_t *layer_criterias_for_sway_layer_surface(struct sway_layer_surface *sway_layer); | ||
|
||
// Parses the `layer_criteria` and applies the effects to the `sway_layer_surface` | ||
void layer_criteria_parse(struct sway_layer_surface *sway_layer, struct layer_criteria *criteria); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <ctype.h> | ||
#include "log.h" | ||
#include "stringop.h" | ||
#include "sway/commands.h" | ||
#include "sway/config.h" | ||
#include "sway/layer_criteria.h" | ||
#include "sway/output.h" | ||
#include "util.h" | ||
|
||
struct cmd_results *cmd_layer_effects(int argc, char **argv) { | ||
struct cmd_results *error = NULL; | ||
if ((error = checkarg(argc, "layer_effects", EXPECTED_AT_LEAST, 2))) { | ||
return error; | ||
} | ||
|
||
struct layer_criteria *criteria = malloc(sizeof(struct layer_criteria)); | ||
criteria->namespace = malloc(strlen(argv[0]) + 1); | ||
strcpy(criteria->namespace, argv[0]); | ||
criteria->cmdlist = join_args(argv + 1, argc - 1); | ||
|
||
// Check if the rule already exists | ||
if (layer_criteria_already_exists(criteria)) { | ||
sway_log(SWAY_DEBUG, "layer_effect already exists: '%s' '%s'", | ||
criteria->namespace, criteria->cmdlist); | ||
layer_criteria_destroy(criteria); | ||
return cmd_results_new(CMD_SUCCESS, NULL); | ||
} | ||
|
||
list_add(config->layer_criteria, criteria); | ||
sway_log(SWAY_DEBUG, "layer_effect: '%s' '%s' added", criteria->namespace, criteria->cmdlist); | ||
|
||
return cmd_results_new(CMD_SUCCESS, NULL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
415e072
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ErikReider After this commit, swaync starts showing default borders around notifications and control centre. Do you know how I can disable this? I have added a snippet below.
https://autumn.revolt.chat/attachments/D4VtcUP6Yxap9Uk_lCVIfcHaboLwHoDngqCGDblfVN
415e072
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Red1922 borders are never drawn on layer surfaces. Might be a custom CSS issue. Test with the default CSS :)
415e072
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yep. Sorry, my bad. When you mentioned that I remembered that I had tweaked the window borders in the gtk css file in the morning to try to have the file picker have borders as it uses client-side decorations so my sway defined borders don't work and it looks really off. It didn't cross my mind that it would show borders here as well. I removed that part of the css and now it's all fine.