Skip to content

Fix yad --html white rectangle at startup #327

@TC100000

Description

@TC100000

When yad --html starts it has an initial white rectangle in the top left corner which is a different color to the startup background.
This is caused by the WebKit browser page initialization.
Proposed fix is to initally set the background to transparent when webview is created and then when loading in the loaded_cb callback set the background back to white.

The following is fix to yad v 14.2

diff src/html.c src/html.c.bgfix

52a53
> static guint bg_set = 0;
135a137,143
>   if (ev == WEBKIT_LOAD_COMMITTED && bg_set == 0 )
>   {
>     GdkRGBA bg = {1.0, 1.0, 1.0, 1.0};  /* Restore background to White */
>     webkit_web_view_set_background_color(v, &bg);
>     bg_set = 1;
>   }
> 
557a566,569
> 
>   GdkRGBA bg = {0, 0, 0, 0};   /* Set bg to Transparent */
>   webkit_web_view_set_background_color(view, &bg);
> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions