Anti-aliasing in the awesome window managerAwesome window manager doesn't react on clicks at toolbar when Caps Lock is onAwesome desktop manager widgetsAwesome window manager has horizontal tearing?Search files in awesome windows managerAwesome-wm and YouTube (html5) window issueSet “scaling” factor with awesome window managerBackground image not set in awesome window managerHow to remove title bar in awesome window manager ver >4Changing contents of global variables in a Lua script for Awesome Window Manager?How to set awesome-wm windows colors
Duck, duck, gone!
GPLv3 forces us to make code available, but to who?
PhD Length: are shorter PhD degrees (from different countries) valued differently in other counter countries where PhD Is a longer process?
How dangerous is a very out-of-true disc brake wheel?
Can a passenger predict that an airline or a tour operator is about to go bankrupt?
Avoiding dust scattering when you drill
How to identify whether a publisher is genuine or not?
Did Joe Biden "stop a prosecution" into his son in Ukraine? And did he brag about stopping the prosecution?
Does the US Armed Forces refuse to recruit anyone with an IQ less than 83?
Can an untrusted VPN client monitor my network activity?
Could Boris Johnson face criminal charges for illegally proroguing Parliament?
How to level a picture frame hung on a single nail?
Why aren't faces sharp in my f/1.8 portraits even though I'm carefully using center-point autofocus?
How is this situation not a checkmate?
Why do Russians sometimes spell "жирный" (fatty) as "жырный"?
Nurikabe: Sixes
Sending mail to the Professor for PhD, after seeing his tweet
Disable all sound permanently
Why most footers have a background color as a divider of section?
Is there anything on the ISS that would be destroyed if that object were returned to Earth?
Caro-Kann c4-c5 push
What does the triangle look like in this diagram?
Does the 'java' command compile Java programs?
As a team leader is it appropriate to bring in fundraiser candy?
Anti-aliasing in the awesome window manager
Awesome window manager doesn't react on clicks at toolbar when Caps Lock is onAwesome desktop manager widgetsAwesome window manager has horizontal tearing?Search files in awesome windows managerAwesome-wm and YouTube (html5) window issueSet “scaling” factor with awesome window managerBackground image not set in awesome window managerHow to remove title bar in awesome window manager ver >4Changing contents of global variables in a Lua script for Awesome Window Manager?How to set awesome-wm windows colors
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Ok so basically, can we somehow get anti-aliasing in the awesome window manager?
The fonts look amazing and everything but it would be really nice to have anti-aliasing applied to regular widgets in awesome. Anti-aliased round-cornered titlebars would be amazing. Also the other shapes applied to widgets like gears.shape.rounded_rect
or gears.shape.circle
. Or all of the others that have rounded anything.
Is it even possible? I searched for cairo and anti aliasing and I barely found anything and even the people that said something said that it's really hard or just not possible to get really good anti aliasing in cairo.
Also, I looked through an old copy of the awesome-wm repository and at some point I found this in the draw.c
file:
draw_rectangle_gradient(draw_context_t *ctx, area_t geometry, float line_width, bool filled,
vector_t gradient_vector, const color_t *pcolor,
const color_t *pcolor_center, const color_t *pcolor_end)
{
cairo_pattern_t *pat;
cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE);
cairo_set_line_width(ctx->cr, line_width);
cairo_set_miter_limit(ctx->cr, 10.0);
cairo_set_line_join(ctx->cr, CAIRO_LINE_JOIN_MITER);
Now in the current repository I was not able to find anything like this, so my question is "can we users do something to make the rounded shapes in awesome be anti-aliased?"
EDIT: If there is not an easy way, could you direct me into what the changes required would be to make this work?
awesome-wm
add a comment
|
Ok so basically, can we somehow get anti-aliasing in the awesome window manager?
The fonts look amazing and everything but it would be really nice to have anti-aliasing applied to regular widgets in awesome. Anti-aliased round-cornered titlebars would be amazing. Also the other shapes applied to widgets like gears.shape.rounded_rect
or gears.shape.circle
. Or all of the others that have rounded anything.
Is it even possible? I searched for cairo and anti aliasing and I barely found anything and even the people that said something said that it's really hard or just not possible to get really good anti aliasing in cairo.
Also, I looked through an old copy of the awesome-wm repository and at some point I found this in the draw.c
file:
draw_rectangle_gradient(draw_context_t *ctx, area_t geometry, float line_width, bool filled,
vector_t gradient_vector, const color_t *pcolor,
const color_t *pcolor_center, const color_t *pcolor_end)
{
cairo_pattern_t *pat;
cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE);
cairo_set_line_width(ctx->cr, line_width);
cairo_set_miter_limit(ctx->cr, 10.0);
cairo_set_line_join(ctx->cr, CAIRO_LINE_JOIN_MITER);
Now in the current repository I was not able to find anything like this, so my question is "can we users do something to make the rounded shapes in awesome be anti-aliased?"
EDIT: If there is not an easy way, could you direct me into what the changes required would be to make this work?
awesome-wm
add a comment
|
Ok so basically, can we somehow get anti-aliasing in the awesome window manager?
The fonts look amazing and everything but it would be really nice to have anti-aliasing applied to regular widgets in awesome. Anti-aliased round-cornered titlebars would be amazing. Also the other shapes applied to widgets like gears.shape.rounded_rect
or gears.shape.circle
. Or all of the others that have rounded anything.
Is it even possible? I searched for cairo and anti aliasing and I barely found anything and even the people that said something said that it's really hard or just not possible to get really good anti aliasing in cairo.
Also, I looked through an old copy of the awesome-wm repository and at some point I found this in the draw.c
file:
draw_rectangle_gradient(draw_context_t *ctx, area_t geometry, float line_width, bool filled,
vector_t gradient_vector, const color_t *pcolor,
const color_t *pcolor_center, const color_t *pcolor_end)
{
cairo_pattern_t *pat;
cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE);
cairo_set_line_width(ctx->cr, line_width);
cairo_set_miter_limit(ctx->cr, 10.0);
cairo_set_line_join(ctx->cr, CAIRO_LINE_JOIN_MITER);
Now in the current repository I was not able to find anything like this, so my question is "can we users do something to make the rounded shapes in awesome be anti-aliased?"
EDIT: If there is not an easy way, could you direct me into what the changes required would be to make this work?
awesome-wm
Ok so basically, can we somehow get anti-aliasing in the awesome window manager?
The fonts look amazing and everything but it would be really nice to have anti-aliasing applied to regular widgets in awesome. Anti-aliased round-cornered titlebars would be amazing. Also the other shapes applied to widgets like gears.shape.rounded_rect
or gears.shape.circle
. Or all of the others that have rounded anything.
Is it even possible? I searched for cairo and anti aliasing and I barely found anything and even the people that said something said that it's really hard or just not possible to get really good anti aliasing in cairo.
Also, I looked through an old copy of the awesome-wm repository and at some point I found this in the draw.c
file:
draw_rectangle_gradient(draw_context_t *ctx, area_t geometry, float line_width, bool filled,
vector_t gradient_vector, const color_t *pcolor,
const color_t *pcolor_center, const color_t *pcolor_end)
{
cairo_pattern_t *pat;
cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE);
cairo_set_line_width(ctx->cr, line_width);
cairo_set_miter_limit(ctx->cr, 10.0);
cairo_set_line_join(ctx->cr, CAIRO_LINE_JOIN_MITER);
Now in the current repository I was not able to find anything like this, so my question is "can we users do something to make the rounded shapes in awesome be anti-aliased?"
EDIT: If there is not an easy way, could you direct me into what the changes required would be to make this work?
awesome-wm
awesome-wm
edited Mar 28 at 20:59
LawsDontApplyToPigs
asked Mar 28 at 20:51
LawsDontApplyToPigsLawsDontApplyToPigs
155 bronze badges
155 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
Anti-aliased round-cornered titlebars would be amazing
Non-rectangular windows are done in X11 with the SHAPE extension. This extension only allows "this pixel is in the window" or "this pixel is outside of the window". Thus, no anti-aliasing is possible here.
https://www.x.org/releases/X11R7.7/doc/xextproto/shape.html
However, when you have a compositing manager running, one can add an alpha channel to a window. This allows things to be e.g. 50% translucent. Thus, with this, an alpha channel is possible.
So, in AwesomeWM, you could do a outside-rounded border around a client by setting border width to zero and instead adding a titlebar on each side of the client that contains some "real transparency".
A cheap example that does not actually do rounded corners, but shows transparency:
local my_widget = wibox.widget.base.make_widget()
local cairo = require("lgi").cairo
function my_widget:draw(_, cr, width, height)
cr:set_operator(cairo.Operator.SOURCE)
cr:set_source(gears.color.create_linear_pattern
from = 0, 0 ,
to = width, 0 ,
stops =
0, "#f000" ,
1, "#0f0f" ,
,
)
cr:paint()
end
awful.titlebar(c, position = "bottom" ):set_widget(my_widget)
In this way, one could do a titlebar that draws a rounded corner in an anti-aliased way. However, this would require doing things in multiple pieces, because we need to create each titlebar separately.
Also, this can only do a rounded corner on the outside. On the inside (i.e. towards the actual client content), AwesomeWM only provides access to the shape extension. However, we would have to draw something on the actual client window to have an antialiased rounded corner. This is currently not possible.
(I hope this paragraph can be understood. Somehow I feel like it is hard to describe/understand.)
Also the other shapes applied to widgets like gears.shape.rounded_rect or gears.shape.circle.
Well... I'm not sure why you think that there is no antialiasing here.
local w = wibox x = 10, y = 10, height = 300, width = 300
w:setup
widget = wibox.container.background,
bg = '#f00',
widget = wibox.container.background,
shape = gears.shape.circle,
bg = '#0f0',
w.visible = true
A zoom into the resulting image clearly shows antialiasing:
Or all of the others that have rounded anything.
This is actually not specific to the shape, but to the thing that applies the shape. For example wibox.container.background
(which "draws directly" and thus can do antialiasing) versus awful.client.shape
(which uses the X11 shape extension and thus cannot do antialiasing).
Thanks for the thorough response! I do have a few more questions on this but I think reddit would be a better place to discuss. Here's the link if you want to join in!
– LawsDontApplyToPigs
Mar 31 at 10:49
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406674%2fanti-aliasing-in-the-awesome-window-manager%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Anti-aliased round-cornered titlebars would be amazing
Non-rectangular windows are done in X11 with the SHAPE extension. This extension only allows "this pixel is in the window" or "this pixel is outside of the window". Thus, no anti-aliasing is possible here.
https://www.x.org/releases/X11R7.7/doc/xextproto/shape.html
However, when you have a compositing manager running, one can add an alpha channel to a window. This allows things to be e.g. 50% translucent. Thus, with this, an alpha channel is possible.
So, in AwesomeWM, you could do a outside-rounded border around a client by setting border width to zero and instead adding a titlebar on each side of the client that contains some "real transparency".
A cheap example that does not actually do rounded corners, but shows transparency:
local my_widget = wibox.widget.base.make_widget()
local cairo = require("lgi").cairo
function my_widget:draw(_, cr, width, height)
cr:set_operator(cairo.Operator.SOURCE)
cr:set_source(gears.color.create_linear_pattern
from = 0, 0 ,
to = width, 0 ,
stops =
0, "#f000" ,
1, "#0f0f" ,
,
)
cr:paint()
end
awful.titlebar(c, position = "bottom" ):set_widget(my_widget)
In this way, one could do a titlebar that draws a rounded corner in an anti-aliased way. However, this would require doing things in multiple pieces, because we need to create each titlebar separately.
Also, this can only do a rounded corner on the outside. On the inside (i.e. towards the actual client content), AwesomeWM only provides access to the shape extension. However, we would have to draw something on the actual client window to have an antialiased rounded corner. This is currently not possible.
(I hope this paragraph can be understood. Somehow I feel like it is hard to describe/understand.)
Also the other shapes applied to widgets like gears.shape.rounded_rect or gears.shape.circle.
Well... I'm not sure why you think that there is no antialiasing here.
local w = wibox x = 10, y = 10, height = 300, width = 300
w:setup
widget = wibox.container.background,
bg = '#f00',
widget = wibox.container.background,
shape = gears.shape.circle,
bg = '#0f0',
w.visible = true
A zoom into the resulting image clearly shows antialiasing:
Or all of the others that have rounded anything.
This is actually not specific to the shape, but to the thing that applies the shape. For example wibox.container.background
(which "draws directly" and thus can do antialiasing) versus awful.client.shape
(which uses the X11 shape extension and thus cannot do antialiasing).
Thanks for the thorough response! I do have a few more questions on this but I think reddit would be a better place to discuss. Here's the link if you want to join in!
– LawsDontApplyToPigs
Mar 31 at 10:49
add a comment
|
Anti-aliased round-cornered titlebars would be amazing
Non-rectangular windows are done in X11 with the SHAPE extension. This extension only allows "this pixel is in the window" or "this pixel is outside of the window". Thus, no anti-aliasing is possible here.
https://www.x.org/releases/X11R7.7/doc/xextproto/shape.html
However, when you have a compositing manager running, one can add an alpha channel to a window. This allows things to be e.g. 50% translucent. Thus, with this, an alpha channel is possible.
So, in AwesomeWM, you could do a outside-rounded border around a client by setting border width to zero and instead adding a titlebar on each side of the client that contains some "real transparency".
A cheap example that does not actually do rounded corners, but shows transparency:
local my_widget = wibox.widget.base.make_widget()
local cairo = require("lgi").cairo
function my_widget:draw(_, cr, width, height)
cr:set_operator(cairo.Operator.SOURCE)
cr:set_source(gears.color.create_linear_pattern
from = 0, 0 ,
to = width, 0 ,
stops =
0, "#f000" ,
1, "#0f0f" ,
,
)
cr:paint()
end
awful.titlebar(c, position = "bottom" ):set_widget(my_widget)
In this way, one could do a titlebar that draws a rounded corner in an anti-aliased way. However, this would require doing things in multiple pieces, because we need to create each titlebar separately.
Also, this can only do a rounded corner on the outside. On the inside (i.e. towards the actual client content), AwesomeWM only provides access to the shape extension. However, we would have to draw something on the actual client window to have an antialiased rounded corner. This is currently not possible.
(I hope this paragraph can be understood. Somehow I feel like it is hard to describe/understand.)
Also the other shapes applied to widgets like gears.shape.rounded_rect or gears.shape.circle.
Well... I'm not sure why you think that there is no antialiasing here.
local w = wibox x = 10, y = 10, height = 300, width = 300
w:setup
widget = wibox.container.background,
bg = '#f00',
widget = wibox.container.background,
shape = gears.shape.circle,
bg = '#0f0',
w.visible = true
A zoom into the resulting image clearly shows antialiasing:
Or all of the others that have rounded anything.
This is actually not specific to the shape, but to the thing that applies the shape. For example wibox.container.background
(which "draws directly" and thus can do antialiasing) versus awful.client.shape
(which uses the X11 shape extension and thus cannot do antialiasing).
Thanks for the thorough response! I do have a few more questions on this but I think reddit would be a better place to discuss. Here's the link if you want to join in!
– LawsDontApplyToPigs
Mar 31 at 10:49
add a comment
|
Anti-aliased round-cornered titlebars would be amazing
Non-rectangular windows are done in X11 with the SHAPE extension. This extension only allows "this pixel is in the window" or "this pixel is outside of the window". Thus, no anti-aliasing is possible here.
https://www.x.org/releases/X11R7.7/doc/xextproto/shape.html
However, when you have a compositing manager running, one can add an alpha channel to a window. This allows things to be e.g. 50% translucent. Thus, with this, an alpha channel is possible.
So, in AwesomeWM, you could do a outside-rounded border around a client by setting border width to zero and instead adding a titlebar on each side of the client that contains some "real transparency".
A cheap example that does not actually do rounded corners, but shows transparency:
local my_widget = wibox.widget.base.make_widget()
local cairo = require("lgi").cairo
function my_widget:draw(_, cr, width, height)
cr:set_operator(cairo.Operator.SOURCE)
cr:set_source(gears.color.create_linear_pattern
from = 0, 0 ,
to = width, 0 ,
stops =
0, "#f000" ,
1, "#0f0f" ,
,
)
cr:paint()
end
awful.titlebar(c, position = "bottom" ):set_widget(my_widget)
In this way, one could do a titlebar that draws a rounded corner in an anti-aliased way. However, this would require doing things in multiple pieces, because we need to create each titlebar separately.
Also, this can only do a rounded corner on the outside. On the inside (i.e. towards the actual client content), AwesomeWM only provides access to the shape extension. However, we would have to draw something on the actual client window to have an antialiased rounded corner. This is currently not possible.
(I hope this paragraph can be understood. Somehow I feel like it is hard to describe/understand.)
Also the other shapes applied to widgets like gears.shape.rounded_rect or gears.shape.circle.
Well... I'm not sure why you think that there is no antialiasing here.
local w = wibox x = 10, y = 10, height = 300, width = 300
w:setup
widget = wibox.container.background,
bg = '#f00',
widget = wibox.container.background,
shape = gears.shape.circle,
bg = '#0f0',
w.visible = true
A zoom into the resulting image clearly shows antialiasing:
Or all of the others that have rounded anything.
This is actually not specific to the shape, but to the thing that applies the shape. For example wibox.container.background
(which "draws directly" and thus can do antialiasing) versus awful.client.shape
(which uses the X11 shape extension and thus cannot do antialiasing).
Anti-aliased round-cornered titlebars would be amazing
Non-rectangular windows are done in X11 with the SHAPE extension. This extension only allows "this pixel is in the window" or "this pixel is outside of the window". Thus, no anti-aliasing is possible here.
https://www.x.org/releases/X11R7.7/doc/xextproto/shape.html
However, when you have a compositing manager running, one can add an alpha channel to a window. This allows things to be e.g. 50% translucent. Thus, with this, an alpha channel is possible.
So, in AwesomeWM, you could do a outside-rounded border around a client by setting border width to zero and instead adding a titlebar on each side of the client that contains some "real transparency".
A cheap example that does not actually do rounded corners, but shows transparency:
local my_widget = wibox.widget.base.make_widget()
local cairo = require("lgi").cairo
function my_widget:draw(_, cr, width, height)
cr:set_operator(cairo.Operator.SOURCE)
cr:set_source(gears.color.create_linear_pattern
from = 0, 0 ,
to = width, 0 ,
stops =
0, "#f000" ,
1, "#0f0f" ,
,
)
cr:paint()
end
awful.titlebar(c, position = "bottom" ):set_widget(my_widget)
In this way, one could do a titlebar that draws a rounded corner in an anti-aliased way. However, this would require doing things in multiple pieces, because we need to create each titlebar separately.
Also, this can only do a rounded corner on the outside. On the inside (i.e. towards the actual client content), AwesomeWM only provides access to the shape extension. However, we would have to draw something on the actual client window to have an antialiased rounded corner. This is currently not possible.
(I hope this paragraph can be understood. Somehow I feel like it is hard to describe/understand.)
Also the other shapes applied to widgets like gears.shape.rounded_rect or gears.shape.circle.
Well... I'm not sure why you think that there is no antialiasing here.
local w = wibox x = 10, y = 10, height = 300, width = 300
w:setup
widget = wibox.container.background,
bg = '#f00',
widget = wibox.container.background,
shape = gears.shape.circle,
bg = '#0f0',
w.visible = true
A zoom into the resulting image clearly shows antialiasing:
Or all of the others that have rounded anything.
This is actually not specific to the shape, but to the thing that applies the shape. For example wibox.container.background
(which "draws directly" and thus can do antialiasing) versus awful.client.shape
(which uses the X11 shape extension and thus cannot do antialiasing).
answered Mar 30 at 9:19
Uli SchlachterUli Schlachter
5,75218 silver badges30 bronze badges
5,75218 silver badges30 bronze badges
Thanks for the thorough response! I do have a few more questions on this but I think reddit would be a better place to discuss. Here's the link if you want to join in!
– LawsDontApplyToPigs
Mar 31 at 10:49
add a comment
|
Thanks for the thorough response! I do have a few more questions on this but I think reddit would be a better place to discuss. Here's the link if you want to join in!
– LawsDontApplyToPigs
Mar 31 at 10:49
Thanks for the thorough response! I do have a few more questions on this but I think reddit would be a better place to discuss. Here's the link if you want to join in!
– LawsDontApplyToPigs
Mar 31 at 10:49
Thanks for the thorough response! I do have a few more questions on this but I think reddit would be a better place to discuss. Here's the link if you want to join in!
– LawsDontApplyToPigs
Mar 31 at 10:49
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406674%2fanti-aliasing-in-the-awesome-window-manager%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown