diff options
Diffstat (limited to 'sway/desktop/shaders/tex_external.frag')
-rw-r--r-- | sway/desktop/shaders/tex_external.frag | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sway/desktop/shaders/tex_external.frag b/sway/desktop/shaders/tex_external.frag index 404688c2..0703a05f 100644 --- a/sway/desktop/shaders/tex_external.frag +++ b/sway/desktop/shaders/tex_external.frag @@ -8,13 +8,16 @@ uniform float alpha; uniform vec2 size; uniform vec2 position; uniform float radius; +uniform bool has_titlebar; void main() { gl_FragColor = texture2D(texture0, v_texcoord) * alpha; - vec2 corner_distance = min(gl_FragCoord.xy - position, position + size - gl_FragCoord.xy); - if (max(corner_distance.x, corner_distance.y) < radius) { - float d = radius - distance(corner_distance, vec2(radius)); - float smooth = smoothstep(-1.0f, 0.5f, d); - gl_FragColor = mix(vec4(0), gl_FragColor, smooth); - } + if (!has_titlebar || gl_FragCoord.y - position.y > radius) { + vec2 corner_distance = min(gl_FragCoord.xy - position, size + position - gl_FragCoord.xy); + if (max(corner_distance.x, corner_distance.y) < radius) { + float d = radius - distance(corner_distance, vec2(radius)); + float smooth = smoothstep(-1.0f, 0.5f, d); + gl_FragColor = mix(vec4(0), gl_FragColor, smooth); + } + } } |