Summary: | oxygen-gtk crashes on rendering background of offscreen windows | ||
---|---|---|---|
Product: | [Plasma] Oxygen | Reporter: | Jakub Filak <filak.jakub> |
Component: | gtk3-engine | Assignee: | Hugo Pereira Da Costa <hugo.pereira.da.costa> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | b7.10110111, hugo.pereira.da.costa, web |
Priority: | NOR | ||
Version: | 4.0 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | proposed patch |
Description
Jakub Filak
2012-06-09 16:29:52 UTC
Created attachment 71684 [details]
proposed patch
I'm not sure where fix this bug. I usually choose the way of minimal changes therefore I added a special casing for offscreen windows to oxygen-gtk code.
> gdk_offscreen_window_class_init() : gdk/gdkoffscreenwindow.c : 766
> impl_class->get_frame_extents = NULL;
Great... so they think we should know that for some windows the methods aren't implemented... especially if this is undocumented.
Your patch looks good, but... doesn't this look like a GTK bug? Have you asked GTK devs what they think of this?
You are right, it looks like a GTK bug. But, according to the following comment from gtk/gtkoffscreenwindow.c file: * GtkOffscreenWindow derives from #GtkWindow only as an implementation * detail. Applications should not use any API specific to #GtkWindow * to operate on this object. It should be treated as a #GtkBin that * has no parent widget. it is an intention to not treat an offscreen window as "general window". (now I doubt about correctness of my patch, but I saw similar lines in gtk code) I haven't asked GTK devs ... I'm going to talk to someone from GTK on monday. As I wrote in details, I do think that implementation should always implement all of the inherited methods (if they want to simulate OOP in C they should simulate everything and only subset of features) ... I saw about a dozen of unimplemented methods in offscreen window impl and I bet they won't be willing to implement all of them. (IMHO it doesn't make sense to implement only get_frames_extent() function ) Ruslan ? So what's the plan ? Push the patch ? Resolve as Upstream ? (that is not a fix) ? I think pushing the patch is good. Alternatively, we can actually check if the underlying function is actually implemented or not (similar to what's done in oxygenanimations, l245 or so, in current gtk3 branch, namely: ) GtkWidgetClass* widgetClass = GTK_WIDGET_GET_CLASS( widget ); if( widgetClass && widgetClass->style_updated ) {...} Well, if you are good with more and more hacks here, push it :) More seriously, I think we'll not get gtk devs to fix this on their side so I guess we'll have to do this. So, I'm ok with pushing this patch. I send an email to gtk-devel-list 14 days ago but the email wasn't approved after a week of waiting :( therefore I've created a bug for gtk 3 and I proposed a patch for this bug ... https://bugzilla.gnome.org/show_bug.cgi?id=678369 @Ruslan ... I guess Jakub's patch (to oxygen-gtk3) is actually less hacky than mine so I'd rather push his. (to minimize hacks) @Jakub, The patch you submitted to gtk3 is impressive and cool. Keep us posted if it ever gets pushed. I spent about 4 hours with coding and testing but I have never believed that the patch can be accepted :D ... mmm unless I misunderstood, I cannot reproduce with glade3 version 3.8.2 and gtk3 version 3.5.2 See: http://wstaw.org/m/2012/06/21/plasma-desktoppF2751.png (after clicking from new project on the leftmost button (first row) below TopLevel). What do I miss ? From glade git: commit ebd9b9a5c28b5ec50c29c19f3b7f8f6d83ed93ac Author: Juan Pablo Ugarte <jp@synctv.com> Date: Wed Jan 12 16:20:13 2011 -0300 Experimental offscreen GladeDesignLayout commit 121840b6082224fd5444af1eca61f9234b726eba Author: Tristan Van Berkom <tristan.van.berkom@gmail.com> Date: Tue Feb 1 19:56:07 2011 +0900 ... NEWS +Glade 3.9.2 ... + - Added support for editing a GtkOffscreenWindow ... So I guess, you have to use at least glade 3.9.2. I wrote glade3-3.10.0-6.fc16.x86_64 to bug description. And as you may see here https://bugs.launchpad.net/ubuntu/+source/anjuta/+bug/982645 glade is not the only app which uses offscreen windows. Git commit 99da2cf5a71b99d268ddee12c4b1c8ad678172ca by Hugo Pereira Da Costa. Committed on 21/06/2012 at 17:50. Pushed by hpereiradacosta into branch 'gtk3'. do not call gdk_window_get_frame_extents on OFFSCREEN_WINDOWS, because underlying function is not implemented, which results in crash. M +15 -4 src/oxygengtkutils.cpp http://commits.kde.org/oxygen-gtk/99da2cf5a71b99d268ddee12c4b1c8ad678172ca Git commit 9ae5ad4fe0f393b8ebcda1050ee0a19e3da18650 by Hugo Pereira Da Costa. Committed on 21/06/2012 at 17:50. Pushed by hpereiradacosta into branch 'gtk3-1.0'. do not call gdk_window_get_frame_extents on OFFSCREEN_WINDOWS, because underlying function is not implemented, which results in crash. M +15 -4 src/oxygengtkutils.cpp http://commits.kde.org/oxygen-gtk/9ae5ad4fe0f393b8ebcda1050ee0a19e3da18650 So ... fixed. As for the actual gtk3 bug, a 'simpler' patch, that might get accepted would be to just check for the validity of the get_frame_extents function pointer in the wrapper function gdk_window_get_frame_extents, dump an error string and leave the rect unchanged. At least this would result in no crash. Closing. Thanks for tracking this down, reporting, and providing the patch (that's ideal bug report I'd say. Wish we had more like these :)) |