diff --git a/doc/rofi-theme.5.markdown b/doc/rofi-theme.5.markdown index e1fb7ed0..dc0626b4 100644 --- a/doc/rofi-theme.5.markdown +++ b/doc/rofi-theme.5.markdown @@ -964,6 +964,11 @@ The following properties are currently supported: - **border-radius**: padding Sets a radius on the corners of the borders. +- border-aa: boolean + Disable aliasing on the border line. Disabling fixes some drawing issues because of nvidia broken driver workaround. + +- border-disable-nvidia-workaround: boolean + Disable work-around for nvidia driver breaking. - **background-color**: color Background color @@ -985,10 +990,10 @@ The following properties are currently supported: - **transparency**: string Indicating if transparency should be used and what type: - - **real** - True transparency. Only works with a compositor. - - **background** - Take a screenshot of the background image and use that. - - **screenshot** - Take a screenshot of the screen and use that. - - **Path** to png file - Use an image. + - **real** - True transparency. Only works with a compositor. + - **background** - Take a screenshot of the background image and use that. + - **screenshot** - Take a screenshot of the screen and use that. + - **Path** to png file - Use an image. - **location**: position The place of the anchor on the monitor diff --git a/include/widgets/widget-internal.h b/include/widgets/widget-internal.h index 8cc0a295..54870882 100644 --- a/include/widgets/widget-internal.h +++ b/include/widgets/widget-internal.h @@ -83,6 +83,12 @@ struct _widget { gboolean expand; /** Place widget at end of parent */ gboolean end; + + /** enable/disable border aliasing. */ + gboolean border_antialiasing; + /** enable/disable nvisia workaround. */ + gboolean border_disable_nvidia_workaround; + /** Parent widget */ struct _widget *parent; /** Internal */ diff --git a/source/widgets/widget.c b/source/widgets/widget.c index 830c98fa..7e60db8d 100644 --- a/source/widgets/widget.c +++ b/source/widgets/widget.c @@ -24,6 +24,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ +#include "cairo.h" #include "config.h" #include "theme.h" @@ -53,6 +54,10 @@ void widget_init(widget *wid, widget *parent, WidgetType type, // enabled by default wid->enabled = rofi_theme_get_boolean(wid, "enabled", TRUE); + + wid->border_antialiasing = rofi_theme_get_boolean(wid, "border-aa", TRUE); + wid->border_disable_nvidia_workaround = + rofi_theme_get_boolean(wid, "border-disable-nvidia-workaround", FALSE); } void widget_set_state(widget *wid, const char *state) { @@ -251,7 +256,12 @@ void widget_draw(widget *wid, cairo_t *d) { if (left != 0 || top != 0 || right != 0 || bottom != 0) { cairo_save(d); - // cairo_set_operator(d, CAIRO_OPERATOR_ADD); + if (wid->border_antialiasing == FALSE) { + cairo_set_antialias(d, CAIRO_ANTIALIAS_NONE); + } + if (wid->border_disable_nvidia_workaround) { + cairo_set_operator(d, CAIRO_OPERATOR_ADD); + } cairo_translate(d, wid->x, wid->y); cairo_new_path(d); rofi_theme_get_color(wid, "border-color", d);