@@ -469,6 +469,25 @@ typedef struct {
469
469
/// Height of the textures.
470
470
int height ;
471
471
} glx_blur_cache_t ;
472
+
473
+ typedef struct {
474
+ /// GLSL program.
475
+ GLuint prog ;
476
+ /// Location of uniform "opacity" in window GLSL program.
477
+ GLint unifm_opacity ;
478
+ /// Location of uniform "invert_color" in blur GLSL program.
479
+ GLint unifm_invert_color ;
480
+ /// Location of uniform "tex" in window GLSL program.
481
+ GLint unifm_tex ;
482
+ } glx_prog_main_t ;
483
+
484
+ #define GLX_PROG_MAIN_INIT { \
485
+ .prog = 0, \
486
+ .unifm_opacity = -1, \
487
+ .unifm_invert_color = -1, \
488
+ .unifm_tex = -1, \
489
+ }
490
+
472
491
#endif
473
492
474
493
typedef struct {
@@ -536,17 +555,21 @@ typedef struct _options_t {
536
555
int glx_swap_method ;
537
556
/// Whether to use GL_EXT_gpu_shader4 to (hopefully) accelerates blurring.
538
557
bool glx_use_gpushader4 ;
539
- /// Whether to try to detect WM windows and mark them as focused.
540
- bool mark_wmwin_focused ;
541
- /// Whether to mark override-redirect windows as focused.
542
- bool mark_ovredir_focused ;
558
+ /// Custom fragment shader for painting windows, as a string.
559
+ char * glx_fshader_win_str ;
560
+ #ifdef CONFIG_VSYNC_OPENGL_GLSL
561
+ /// Custom GLX program used for painting window.
562
+ glx_prog_main_t glx_prog_win ;
563
+ #endif
543
564
/// Whether to fork to background.
544
565
bool fork_after_register ;
545
566
/// Whether to detect rounded corners.
546
567
bool detect_rounded_corners ;
547
568
/// Whether to paint on X Composite overlay window instead of root
548
569
/// window.
549
570
bool paint_on_overlay ;
571
+ /// Force painting of window content with blending.
572
+ bool force_win_blend ;
550
573
/// Resize damage for a specific number of pixels.
551
574
int resize_damage ;
552
575
/// Whether to unredirect all windows if a full-screen opaque window
@@ -622,6 +645,8 @@ typedef struct _options_t {
622
645
time_ms_t fade_delta ;
623
646
/// Whether to disable fading on window open/close.
624
647
bool no_fading_openclose ;
648
+ /// Whether to disable fading on ARGB managed destroyed windows.
649
+ bool no_fading_destroyed_argb ;
625
650
/// Fading blacklist. A linked list of conditions.
626
651
c2_lptr_t * fade_blacklist ;
627
652
@@ -672,6 +697,10 @@ typedef struct _options_t {
672
697
// === Focus related ===
673
698
/// Consider windows of specific types to be always focused.
674
699
bool wintype_focus [NUM_WINTYPES ];
700
+ /// Whether to try to detect WM windows and mark them as focused.
701
+ bool mark_wmwin_focused ;
702
+ /// Whether to mark override-redirect windows as focused.
703
+ bool mark_ovredir_focused ;
675
704
/// Whether to use EWMH _NET_ACTIVE_WINDOW to find active window.
676
705
bool use_ewmh_active_win ;
677
706
/// A list of windows always to be considered focused.
@@ -1965,6 +1994,14 @@ win_is_fullscreen(session_t *ps, const win *w) {
1965
1994
&& (!w -> bounding_shaped || w -> rounded_corners );
1966
1995
}
1967
1996
1997
+ /**
1998
+ * Check if a window will be painted solid.
1999
+ */
2000
+ static inline bool
2001
+ win_is_solid (session_t * ps , const win * w ) {
2002
+ return WMODE_SOLID == w -> mode && !ps -> o .force_win_blend ;
2003
+ }
2004
+
1968
2005
/**
1969
2006
* Determine if a window has a specific property.
1970
2007
*
@@ -2073,6 +2110,13 @@ glx_on_root_change(session_t *ps);
2073
2110
bool
2074
2111
glx_init_blur (session_t * ps );
2075
2112
2113
+ #ifdef CONFIG_VSYNC_OPENGL_GLSL
2114
+ bool
2115
+ glx_load_prog_main (session_t * ps ,
2116
+ const char * vshader_str , const char * fshader_str ,
2117
+ glx_prog_main_t * pprogram );
2118
+ #endif
2119
+
2076
2120
bool
2077
2121
glx_bind_pixmap (session_t * ps , glx_texture_t * * pptex , Pixmap pixmap ,
2078
2122
unsigned width , unsigned height , unsigned depth );
@@ -2108,10 +2152,24 @@ glx_dim_dst(session_t *ps, int dx, int dy, int width, int height, float z,
2108
2152
GLfloat factor , XserverRegion reg_tgt , const reg_data_t * pcache_reg );
2109
2153
2110
2154
bool
2111
- glx_render (session_t * ps , const glx_texture_t * ptex ,
2155
+ glx_render_ (session_t * ps , const glx_texture_t * ptex ,
2112
2156
int x , int y , int dx , int dy , int width , int height , int z ,
2113
- double opacity , bool neg ,
2114
- XserverRegion reg_tgt , const reg_data_t * pcache_reg );
2157
+ double opacity , bool argb , bool neg ,
2158
+ XserverRegion reg_tgt , const reg_data_t * pcache_reg
2159
+ #ifdef CONFIG_VSYNC_OPENGL_GLSL
2160
+ , const glx_prog_main_t * pprogram
2161
+ #endif
2162
+ );
2163
+
2164
+ #ifdef CONFIG_VSYNC_OPENGL_GLSL
2165
+ #define \
2166
+ glx_render (ps , ptex , x , y , dx , dy , width , height , z , opacity , argb , neg , reg_tgt , pcache_reg , pprogram ) \
2167
+ glx_render_(ps, ptex, x, y, dx, dy, width, height, z, opacity, argb, neg, reg_tgt, pcache_reg, pprogram)
2168
+ #else
2169
+ #define \
2170
+ glx_render (ps , ptex , x , y , dx , dy , width , height , z , opacity , argb , neg , reg_tgt , pcache_reg , pprogram ) \
2171
+ glx_render_(ps, ptex, x, y, dx, dy, width, height, z, opacity, argb, neg, reg_tgt, pcache_reg)
2172
+ #endif
2115
2173
2116
2174
void
2117
2175
glx_swap_copysubbuffermesa (session_t * ps , XserverRegion reg );
@@ -2122,6 +2180,10 @@ glx_create_shader(GLenum shader_type, const char *shader_str);
2122
2180
2123
2181
GLuint
2124
2182
glx_create_program (const GLuint * const shaders , int nshaders );
2183
+
2184
+ GLuint
2185
+ glx_create_program_from_str (const char * vert_shader_str ,
2186
+ const char * frag_shader_str );
2125
2187
#endif
2126
2188
2127
2189
/**
0 commit comments