[Xfce4-commits] [apps/xfce4-notifyd] 01/01: Disable rounded corners w/o compositing (Bug #16586)
noreply at xfce.org
noreply at xfce.org
Wed Apr 8 00:40:07 CEST 2020
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-notifyd.
commit cf77f20fb3885a692760deea3783868230dc6dd5
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Wed Apr 8 00:39:22 2020 +0200
Disable rounded corners w/o compositing (Bug #16586)
---
xfce4-notifyd/xfce-notify-window.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/xfce4-notifyd/xfce-notify-window.c b/xfce4-notifyd/xfce-notify-window.c
index 28e1307..c3fcdd8 100644
--- a/xfce4-notifyd/xfce-notify-window.c
+++ b/xfce4-notifyd/xfce-notify-window.c
@@ -42,6 +42,8 @@
#define FADE_CHANGE_TIMEOUT 50
#define DEFAULT_RADIUS 10
#define DEFAULT_PADDING 14.0
+#define BASE_CSS ".xfce4-notifyd { font-size: initial; }"
+#define NO_COMPOSITING_CSS ".xfce4-notifyd { border-radius: 0px; }"
struct _XfceNotifyWindow
{
@@ -292,10 +294,11 @@ xfce_notify_window_init(XfceNotifyWindow *window)
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (window)), "xfce4-notifyd");
provider = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (provider, ".xfce4-notifyd { font-size: initial; }", -1, NULL);
+ gtk_css_provider_load_from_data (provider, BASE_CSS, -1, NULL);
gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (window)),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
}
static void
@@ -370,10 +373,23 @@ xfce_notify_window_draw (GtkWidget *widget,
{
GtkStyleContext *context;
GtkAllocation allocation;
+ GdkScreen *screen;
+ GtkCssProvider *provider;
context = gtk_widget_get_style_context (widget);
gtk_widget_get_allocation (widget, &allocation);
+ /* Remove rounded corners when compositing is disabled */
+ screen = gtk_widget_get_screen (widget);
+ if (!gdk_screen_is_composited (screen)) {
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider, NO_COMPOSITING_CSS, -1, NULL);
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+ }
+
/* First make the window transparent */
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.0);
cairo_fill (cr);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list