#291 Allow to build against GTK+ 3

closed-accepted
nobody
None
5
2012-07-13
2012-06-10
No

This patch allows Fuse to build against GTK+ 3, i.e.,
./configure --enable-gtk3

It's disabled by default as GTK+ 3 build is currently broken (uncomplete).

Discussion

1 2 > >> (Page 1 of 2)
  • Fredrick Meunier

    I'm tempted to hold off on this one until we have something that builds against GTK+ 3 to avoid confusion.

     
  • Fredrick Meunier

    Happy to stick it on a GTK+ 3 branch if you want one.

     
  • Sergio Baldoví

    Sergio Baldoví - 2012-06-12

    Fair enough. It's mainly targeted to anyone that want to experiment with GTK3.

    Known outstanding bits to check are:
    - simple combo boxes
    - keycodes
    - pixmaps in status bar
    - mouse pointer grab
    - widget preferred size
    - GtkVBox, GtkVSeparator & co.
    - keyboard picture
    - RGB images blitted onto the display

    IMO, the last one is the most complex and critical change, so a new branch would help with testing.

     
  • Sergio Baldoví

    Sergio Baldoví - 2012-06-24

    Here is a new patch with the rest of pending bits. Now fuse works quite right with GTK3. The performance of display routines is slightly worse than GTK2, but is likely to be negligible. Testing and suggestions are more than welcome.

     
  • Alberto Garcia

    Alberto Garcia - 2012-06-25

    Great work!

    I took a quick look at the patch, maybe for the keysyms stuff you might be interested in including <gdk/gdkkeysyms-compat.h> instead.

     
  • Sergio Baldoví

    Sergio Baldoví - 2012-06-25

    With gdkkeysyms-compat.h, Fuse should use GTK2 key names and translate them for GTK3 builds. With gtkcompat.h, Fuse should use GTK3 key names and translate them for GTK2 builds.

    IMHO both solutions are good. gdkkeysyms-compat.h is simpler but gtkcompat.h offers a long term solution since GTK2 will eventually become obsolete.

    From the gdkkeysyms-compat header:
    "This is a compatibility header your application can include to gain access to the old names as well. Consider porting to the new names instead."

     
  • Alberto Garcia

    Alberto Garcia - 2012-06-25

    Fair enough :)

     
  • Fredrick Meunier

    OSX Screenshot

     
  • Fredrick Meunier

    On OS X 10.7 the screen doesn't seem to update.

    I can also get it to crash by:
    1) Start with 2x mode in saved prefs
    2) Select filter and change it to Normal
    3) Window changes size, screen is drawn from scratch then crash with following message and backtrace (not sure if it is an OS X specific issue with GTK3?):
    $ ./fuse

    The Free Unix Spectrum Emulator (Fuse) version 1.0.0.
    Copyright (c) 1999-2011 Philip Kendall and others; see the file
    'AUTHORS' for more details.

    For help, please mail <fuse-emulator-devel@lists.sf.net> or use
    the forums at <http://sourceforge.net/forum/?group_id=91293>.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Invalid argument. Aborting.
    Abort trap: 6

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 libsystem_kernel.dylib 0x00007fff8d4dfce2 __pthread_kill + 10
    1 libsystem_c.dylib 0x00007fff8a5637d2 pthread_kill + 95
    2 libsystem_c.dylib 0x00007fff8a554a7a abort + 143
    3 libglib-2.0.0.dylib 0x000000010ef9b3e5 g_private_set + 85
    4 libglib-2.0.0.dylib 0x000000010ef7659a thread_memory_from_self + 762
    5 libglib-2.0.0.dylib 0x000000010ef76e8e g_slice_free_chain_with_offset + 190
    6 libgtk-3.0.dylib 0x000000010e3072ab gtk_menu_shell_activate_item + 347
    7 libgtk-3.0.dylib 0x000000010e307f7f gtk_menu_shell_button_release + 191
    8 libgtk-3.0.dylib 0x000000010e2ee20a _gtk_marshal_BOOLEAN__BOXEDv + 218
    9 libgobject-2.0.0.dylib 0x000000010ecdbf75 _g_closure_invoke_va + 309
    10 libgobject-2.0.0.dylib 0x000000010ecec338 g_signal_emit_valist + 1352
    11 libgobject-2.0.0.dylib 0x000000010ececf84 g_signal_emit + 116
    12 libgtk-3.0.dylib 0x000000010e414943 gtk_widget_event_internal + 547
    13 libgtk-3.0.dylib 0x000000010e2edc90 propagate_event + 496
    14 libgtk-3.0.dylib 0x000000010e2ed00f gtk_main_do_event + 1311
    15 libgdk-3.0.dylib 0x000000010e6f7cd7 gdk_event_source_dispatch + 39
    16 libglib-2.0.0.dylib 0x000000010ef5c148 g_main_context_dispatch + 328
    17 libglib-2.0.0.dylib 0x000000010ef5dd1e g_main_context_iterate + 510
    18 libglib-2.0.0.dylib 0x000000010ef5ddb2 g_main_context_iteration + 98
    19 libgtk-3.0.dylib 0x000000010e2eca6c gtk_main_iteration + 28
    20 fuse 0x000000010d1e9e75 ui_event + 21 (gtkui.c:304)
    21 fuse 0x000000010d1e055d spectrum_frame_event_fn + 61 (spectrum.c:81)
    22 fuse 0x000000010d1c9a42 event_do_events + 146 (event.c:138)
    23 fuse 0x000000010d1cab2a main + 3434 (fuse.c:183)
    24 fuse 0x000000010d1c7624 start + 52

    Thread 1:: Dispatch queue: com.apple.libdispatch-manager
    0 libsystem_kernel.dylib 0x00007fff8d4e07e6 kevent + 10
    1 libdispatch.dylib 0x00007fff8a8f678a _dispatch_mgr_invoke + 923
    2 libdispatch.dylib 0x00007fff8a8f531a _dispatch_mgr_thread + 54

    Thread 2:
    0 libsystem_kernel.dylib 0x00007fff8d4dfdf2 __select + 10
    1 fuse 0x000000010d21b1be w5100_io_thread + 398 (w5100.c:118)
    2 libsystem_c.dylib 0x00007fff8a5618bf _pthread_start + 335
    3 libsystem_c.dylib 0x00007fff8a564b75 thread_start + 13

    Thread 3:: com.apple.audio.IOThread.client
    0 libsystem_kernel.dylib 0x00007fff8d4de67a mach_msg_trap + 10
    1 libsystem_kernel.dylib 0x00007fff8d4ddd71 mach_msg + 73
    2 com.apple.audio.CoreAudio 0x00007fff92463eb3 HALB_MachPort::SendMessageWithReply(unsigned int, unsigned int, unsigned int, unsigned int, mach_msg_header_t*, unsigned int) + 93
    3 com.apple.audio.CoreAudio 0x00007fff92463f05 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, unsigned int) + 37
    4 com.apple.audio.CoreAudio 0x00007fff9245d568 HALC_ProxyIOContext::IOWorkLoop() + 888
    5 com.apple.audio.CoreAudio 0x00007fff9245d151 HALC_ProxyIOContext::IOThreadEntry(void*) + 73
    6 com.apple.audio.CoreAudio 0x00007fff9245d00c HALB_IOThread::Entry(void*) + 78
    7 libsystem_c.dylib 0x00007fff8a5618bf _pthread_start + 335
    8 libsystem_c.dylib 0x00007fff8a564b75 thread_start + 13

     
  • Sergio Baldoví

    Sergio Baldoví - 2012-06-28

    The crash seems to me the libxml2 issue reported in bug 3537598.

    Nothing is initially drawn? Umm... I would suggest:

    1. Open "Help -> Keyboard" since the picture has a simple drawing method

    2. Try to set de alpha channel to opaque, maybe we are not watching the updates:
    gtkdisplay_colours[i] = red << 24 | green << 16 | blue << 8 | 255;
    [...]
    gtkdisplay_colours[i] = blue << 24 | green << 16 | red << 8 | 255;
    [...]
    gtkdisplay_colours[i] = red | green << 8 | blue << 16 | 255 << 24;
    [...]
    gtkdisplay_colours[i] = blue | green << 8 | red << 16 | 255 << 24;

     
  • Fredrick Meunier

    The border is set and the paper is black as shown in the screenshot but nothing else happens (you can press keys and hear the button press sound).If you resize you can briefly see the full screen drawn before the crash.

    1. This works fine.

    2. This doesn't help

     
  • Fredrick Meunier

    Maybe something additional needs to be done to get the updated portions of the window to redraw?

     
  • Sergio Baldoví

    Sergio Baldoví - 2012-07-04

    The patch "3a" invalidates areas and schedule a "draw" event. GTK drawing model suggest drawing only in a expose/draw event signal handler, where portability issues are taken into account.

    The previous patch was drawing directly to the window, outside "draw" event because it was considerably faster, especially with lots of small rectangles (i.e., Fly Shark and Shock megademo) in a similar way to GTK2 UI. I'm not sure what is missing but the patch "3b" tries to flush these updates.

    Thanks for your testing.

     
  • Fredrick Meunier

    Thanks Sergio, patch 3a is the one that does the trick.

    If there are no more comments I'll commit this one on Sunday.

     
  • Sergio Baldoví

    Sergio Baldoví - 2012-07-06

    Here is a new patch with minor fixes when both GTK2 and GTK3 dev libraries are installed in the same system. By default Fuse tries to use GTK2 if available, else GTK3 if available. The optional switch --enable-gtk3 sets GTK3 preferably to GTK2.

     
  • Fredrick Meunier

    • status: open --> pending-accepted
     
  • Fredrick Meunier

    Thanks, committed in revision 4723.

     
  • rkd77

    rkd77 - 2012-07-08

    ui/gtk/gtkcompat.c is missing.

     
  • Fredrick Meunier

    Thanks, it should be resolved now.

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks