Bug 1431233 - wayland gtk3 backend breaks screen updates
Summary: wayland gtk3 backend breaks screen updates
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: wxGTK3
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Scott Talbert
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-10 16:41 UTC by Martin Koegler
Modified: 2021-05-25 14:57 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-05-25 14:57:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Koegler 2017-03-10 16:41:09 UTC
My program draws changes to a windows:

void GOGUIPanelWidget::CopyToScreen(wxDC* mdc, const wxRect& rect)
{
        wxClientDC dc(this);
        
        dc.Blit(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight(), mdc, rect.GetX(), rect.GetY());
}

Using x11 GTK3 backend this works. Using the wayland GTK3 backend, the screen is often not updated. Focusing another windows and similar things often (eg. using a second gdb window) yield to a screen update.

Test system: Clean Fedora Workstation 25 QEMU installed including all updates released until today.

Demo programm:
https://software.opensuse.org/download.html?project=home%3Ae9925248%3Agrandorgue&package=grandorgue

Compare clicking on the "Montre 8'" button using GDK_BACKEND=wayland and GDK_BACKEND=x11

Comment 1 Martin Koegler 2017-03-10 16:43:09 UTC
Starting it inside of weston yields to the same result.

Comment 2 Jeremy Newton 2017-03-10 17:48:18 UTC
IIRC, you need to call Refresh() to flag a redraw of the widget on next loop. For some reason the XOrg backend seems to redraw every loop (I'm not sure if this is a bug or just a quirk the XOrg backend).

Taking a quick look, here is the documentation for the wxWindow::Refresh()
http://docs.wxwidgets.org/3.0/classwx_window.html#a29dc7251746154c821b17841b9877830

Comment 3 Jeremy Newton 2017-03-10 17:56:43 UTC
Assuming GOGUIPanelWidget inherits wxPanel, this should work:

void GOGUIPanelWidget::CopyToScreen(wxDC* mdc, const wxRect& rect)
{
        wxClientDC dc(this);
        
        dc.Blit(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight(), mdc, rect.GetX(), rect.GetY());

        Refresh();
}

Here's an example I found quickly online:
http://zetcode.com/gui/wxwidgets/thetetrisgame/

Refresh is called multiple times to request a new draw update.

Comment 4 Martin Koegler 2017-03-10 18:48:28 UTC
Refresh is the normal windows update route. Refresh schedules a paint event and calls OnPaint, which redraws the whole window content via wxPaintDC. 

The code uses wxClientDC:
http://docs.wxwidgets.org/trunk/classwx_client_d_c.html

This class allows direct painting into the windows outside of the normal whole window refresh. This works for OS X, windows and X1, but breaks using GTK3 wayland.

Calling Refresh() as you suggested would result in a double drawing: First wxClientDC would paint something - afterwards Refresh will schedule a whole window redraw.

https://forums.wxwidgets.org/viewtopic.php?t=29909

Comment 5 Martin Koegler 2017-03-11 17:55:01 UTC
wxClientDC, wxWindowDC and wxScreenDC are based on gdk_cairo_create.

This function is already deprecated
https://developer.gnome.org/gdk3/stable/gdk3-Cairo-Interaction.html#gdk-window-create-similar-surface
and will be removed in future versions:
https://git.gnome.org/browse/gtk+/commit/?id=d48adf9cee7e340acd7f8b9a5f9716695352b848

The reason seems to be wayland and its screen update handling - you should just draw during the painting event in the future.

So wxWidgets will need some adaptions.

Comment 6 Martin Koegler 2017-03-12 12:44:53 UTC
Caret wx sample also shows the bug:
http://trac.wxwidgets.org/ticket/17820

Comment 7 Fedora End Of Life 2017-11-16 19:41:35 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2017-12-12 10:49:05 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 Martin Koegler 2018-01-05 18:32:16 UTC
Personally, I have lost interest in this bug, so I won't reopen this bug.

The bug is still unfixed upstream, so it affects current releases too.

Comment 10 Jan Kurik 2018-08-14 10:19:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 11 Ben Cotton 2019-10-31 20:52:02 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2020-02-11 15:46:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 13 Fedora Program Management 2021-04-29 15:53:06 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 14 Ben Cotton 2021-05-25 14:57:16 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.