GNOME Bugzilla – Bug 757324
win32: handle WM_DISPLAYCHANGE globally
Last modified: 2015-10-31 14:33:06 UTC
Instead of handling WM_DISPLAYCHANGE on every GdkWindow, only handle it on an ad-hoc hidden window we create when opening the display. This has two reasons: 1) we want emit the display::size-changed signal even if there are no windows currently open 2) we want to emit the signal just once and not once for every window The patch has some questionable coding style (the case with braces, the split in an "inner" event function, etc, but I kept it like that since it is exactly the same as it is done for the other event win32 handling functions)
Created attachment 314416 [details] [review] patch
It does not call UnregisterClass() anywhere. If the DLL in which RegisterClass() is called can be unloaded without terminating the application, then UnregisterClass() should be used. Other than that everything seems to make sense.
Do you have any suggestion on where we could call unregister? maybe display (or screen) dispose? Note that the clipboard stuff also creates a window that is not unregistered anywhere, I guess that's a bug too
This is not a problem if libgtkwhateveritis.dll can't be unloaded (consult with GObject people on the topic of unloading DLLs that use GObject).
<pbor> mclasen, Company: is unloading gtk supported these days? <Company> no <mclasen> unloading ? <Company> you can't unload GTypes <mclasen> as long as you don't want to reload it, ever, it might be ok <pbor> just asking since it affects a win32 patch... if we care I need to find a way where to UnregisterClass <Company> just don't g_type_class_ref (g_type_get_children(G_TYPE_OBJECT)[n])) ! <pbor> otherwise I just do not do it <Company> don't do it <Company> people can think about unregistering win32 stuff once they unloaded GTK on Linux <pbor> fine with me <pbor> calling UnregisterClass in display::dispose would not be hard <pbor> just wondering if it is worth it <mclasen> it isn't So I'll take that as a no. We can always fix things up if someone complains
I pushed the patch (slightly amended).