GNOME Bugzilla – Bug 536105
Text in GTK disappears after launching DirectX window
Last modified: 2018-02-10 03:21:04 UTC
Hi, I've written a program using GTK that launches a DirectX 8 window in response to a GTK menu selection. It is single threaded. In GTK 2.10.7 this would launch the fullscreen DirectX window and then a routine would pump the windows message queue until the mouse was clicked at which point DirectX would be shut down and control would be returned to GTK. In GTK 2.12.9 and above, the program works as before but after the return of control, no text is displayed by GTK. All the menus and dialogs work, but none of them have any text displayed. I've tried calling 'gtk_main_iteration_do(FALSE);' during the DirectX loop and it makes no difference. Strangely I can recover the situation by opening a freeGLUT window. As soon as it opens, text is drawn again. If someone is interested in getting to the bottom of this I would be willing to try things, or may be able to provide sample code. OS is windows XP. I've tried different GTK themes and they all act the same. Compiler is Visual Studio 2005 express. Thanks, Richard
maybe it's too late, but I solved this problem. GTK use cairo, cairo with D3D cause this BUG. D3D CreateDevice() will change FPU, see google(cairo D3D BUG). so, use CreateDevice() with D3DCREATE_FPU_PRESERVE can fix this problem. pID3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, hwnd , D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE , &present, &pID3DDevice); I hope this comments can help you! LouisLiangJun
Wasn't this fixed upstream in cairo? With the following commit: http://cgit.freedesktop.org/cairo/commit/?id=b62710d4f8602203d848daf2d444865b611fff09 For reference, discussion leading to that commit can be found here: https://bugs.freedesktop.org/show_bug.cgi?id=7497
No, the problem still exists up to present releases. A D3D device created without FPU_PRESERVE still destroys text rendering.
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue for it.