After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 409055 - Terminal stays blank
Terminal stays blank
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.15.x
Other All
: Normal major
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-17 20:32 UTC by Miek Gieben
Modified: 2007-03-15 18:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Miek Gieben 2007-02-17 20:32:06 UTC
Please describe the problem:
When switching workspaces, the gnome-terminal screen sometimes stays blank.
See ubuntu bugreport: 85437 for a screenshot
https://launchpad.net/ubuntu/+source/gnome-terminal/+bug/85437

This is amd64.

Steps to reproduce:
1. open terminal
2. switch workspace
3. switch back, look at terminal, sometimes it stays blank


Actual results:


Expected results:


Does this happen every time?
No

Other information:
Comment 1 Mariano Suárez-Alvarez 2007-02-17 21:15:11 UTC
According to the launchpad bug, this is 2.17.91-0ubuntu1.

Chris, I've seen this too once on a non 64bit x86, using vte's vte. Only it did not stay blank, but just was not repainted. I have not been able to do it since.
Comment 2 Chris Wilson 2007-02-19 11:50:11 UTC
I need a few more hints on how to reproduce this...

The prime suspect is a mishandling of a visibility notify, but going over that path everything looks sane... Except we never receive (Edgy) a fully-obscured notify when leaving the workspace so it should just be a normal expose event.

* perplexed.
Comment 3 Miek Gieben 2007-02-19 11:56:43 UTC
What can I do to debug this? I've looked into the debug flags but I haven't gotten very far.
Comment 4 Chris Wilson 2007-02-19 12:09:44 UTC
Miek, if you can reliably reproduce this, then I think the debug output for VTE_DEBUG_FLAGS=events,updates should help. Also, I've added some more debugging output to HEAD, so if you could try running from svn it might help even more.
Thanks.
Comment 5 Chris Wilson 2007-02-19 15:22:59 UTC
Ok, I've applied a patch to ensure we set the fully-obscured flag when the user switches workspaces. Unfortunately, I think this will only hide whatever bug you have managed to trigger here. However, please try HEAD and see if you can find any aberrant behaviour.

r1698: 2007-02-19  Chris Wilson  <chris@chris-wilson.co.uk>

	As noticed on bug 409055, we do not receive a visibility-notify
	event when we switch workspaces (or even when the window is iconified).
	The workaround for this is to watch for our toplevel being unmapped
	and set the fully-obscured flag.

	* src/vte.c: (vte_terminal_configure_toplevel),
	(vte_terminal_unmap_toplevel), (vte_terminal_hierarchy_changed),
	(vte_terminal_set_visibility), (vte_terminal_visibility_notify):

Comment 6 Miek Gieben 2007-02-19 17:50:19 UTC
Cannot get any output with VTE_DEBUG_FLAG.

but running from:
Path: .
URL: http://svn.gnome.org/svn/gnome-terminal/trunk
Repository Root: http://svn.gnome.org/svn/gnome-terminal
Repository UUID: e32f9464-e525-0410-8908-8a3b6990da27
Revision: 2171

seems to fix the issue. Running ./src/gnome-terminal and a
"normal" one shows that the normal one is blank after a workspace
switch and the one from trunk is not.

thanks!
Comment 7 Mariano Suárez-Alvarez 2007-02-19 17:59:36 UTC
Miek, did you install a new vte too?

(Also, keep in mind that if you run ./src/gnome-terminal while there is already another one running (from ./src or not) then you'll not get a window from ./src but from the already running one. When doing tests, it's always safer to run

  ./src/gnome-terminal --disable-factory

to be sure that one is testing the correct binary.)
Comment 8 Miek Gieben 2007-02-19 20:15:12 UTC
./src/gnome-terminal --disable-factory
gives the same result (i.e: that works), "normal" gnome-terminals still
blank.

Before I just started gnome-terminal from an xterm.

Haven't installed any new libvte. I can thus confirm that the patch seems work.
Comment 9 Mariano Suárez-Alvarez 2007-02-19 20:37:45 UTC
Miek, the patch Chris committed was to vte, not gnome-terminal. If you only built gnome-terminal from trunk, and not vte,then you are not testing the patch ;-)
Comment 10 Miek Gieben 2007-02-19 21:18:43 UTC
Ah, that explains why I still the bug... :P Retrying with a new vte.
Comment 11 Miek Gieben 2007-02-19 22:01:52 UTC
ok, rebuild vte from svn/trunk. I've build debian packages from those sources by copying the debian/ directory from ubuntu into it. Running with those installed
I still get blank terminals... although less often.

Some observations:

Scrolling in Epiphany helps in getting the bug :P

The terminal size also seems to have an effect. I start my gnome-terminals
like this:
/usr/bin/gnome-terminal --geometry 100x60 $@

"normal" started terminals (which are smaller) are not as much affected.

Also, with the new vte, it seems like only one terminal can be affected at the time, unlike previously where all my terminal windows were blanked.

The terminal which "has" the mouse in it, is affected, the other one is not:
1. switch the other workspace
2. move mouse the right
3. switch back
4. terminal with the mouse in it is blank

If I move to the left, the other one is blank, but not always.
Comment 12 Chris Wilson 2007-02-19 22:04:54 UTC
By maximising the terminal, I reproduced this first time. Thanks.
Comment 13 Chris Wilson 2007-02-19 23:54:23 UTC
Hmm, the root cause of this seems to be a reordering of the visibility+expose events:-

Order reported by xev:
MapNotify event, serial 13, synthetic NO, window 0x4e0000f,
    event 0x4e0000f, window 0x4e0000f, override NO
VisibilityNotify event, serial 13, synthetic NO, window 0x4e0000f,
    state VisibilityPartiallyObscured
Expose event, serial 13, synthetic NO, window 0x4e0000f,
    (0,0), width 1537, height 2, count 2
Expose event, serial 13, synthetic NO, window 0x4e0000f,
    (1706,0), width 214, height 2, count 1
Expose event, serial 13, synthetic NO, window 0x4e0000f,
    (0,2), width 1920, height 1150, count 0


Output from gtk+ debug=events:
Gdk-Message: map notify:                window: 85983247
Gdk-Message: expose:            window: 85983247  2     x,y: 0 0  w,h: 1547 2
Gdk-Message: expose:            window: 85983247  1     x,y: 1716 0  w,h: 204 2
Gdk-Message: expose:            window: 85983247  0     x,y: 0 2  w,h: 1920 1150
Gdk-Message: property notify:   window: 85983247, atom(245): "WM_STATE"
Top level parent mapped.
Expose (0,0)x(1920,1152)
Gdk-Message: map notify:                window: 85983286
Gdk-Message: visibility notify: window: 85983286         partial
Gdk-Message: expose:            window: 85983286  2     x,y: 0 0  w,h: 1547 2
Gdk-Message: expose:            window: 85983286  1     x,y: 1716 0  w,h: 204 2
Gdk-Message: expose:            window: 85983286  0     x,y: 0 2  w,h: 1920 1150
Gdk-Message: property notify:   window: 85983247, atom(231): "_NET_WM_STATE"
Gdk-Message: focus in:          window: 85983247, detail: NotifyNonlinear, mode: NotifyNormal
Gdk-Message: client message:    window: 85983247
Gdk-Message: expose:            window: 85983286  0     x,y: 1714 0  w,h: 2 2
Gdk-Message: property notify:   window: 310, atom(288): "_NET_CLIENT_LIST"
Gdk-Message: property notify:   window: 310, atom(289): "_NET_CLIENT_LIST_STACKING"
Gdk-Message: property notify:   window: 310, atom(294): "_NET_ACTIVE_WINDOW"
Gdk-Message: property notify:   window: 310, atom(294): "_NET_ACTIVE_WINDOW"
Visibility (fully-obscured -> partial).


Order as processed by vte:
Top level parent mapped.
Expose (0,0)x(1920,1152)
vte_terminal_paint      (0,0)x(1920,1152) pixels
vte_terminal_paint_area (0,0)x(1920,1152) pixels, (0,0)x(319,88) cells [(0,0)x(1914,1144) pixels]
Visibility (fully-obscured -> partial).

Which basically means that the exposes on the second window (which maps to the same GdkWindow as the first) are amalgamated into a single GdkExposeEvent and processed *before* the visibility notify - which we use to decide if the expose event actually needs to be processed or not.
Comment 14 Chris Wilson 2007-02-20 00:04:23 UTC
r1705: 2007-02-19  Chris Wilson  <chris@chris-wilson.co.uk>

	Bug 409055 – Terminal stays blank

	Due to GTK+ coallescing of XExposeEvents it was possible for our
	GdkExposeEvent to arrive before the GdkVisibilityEvent associated with
	the mapping of our toplevel and so we discarded the event as we
	believed we were still unviewable.

	* src/vte.c: (_vte_invalidate_cells), (vte_terminal_expose),
	(reset_update_regions):
		Assume that all GdkExposeEvents have been checked for
		suitability before delivery. We know this true for locally
		generated expose events which are extensively checked during
		invalidation, and we presume that X will not generate expose
		events on unmapped or otherwise unviewable windows.

Comment 15 Miek Gieben 2007-03-15 18:47:44 UTC
This bug is back with gnome 2.18.