GNOME Bugzilla – Bug 94111
Clean up has_foo_func and related macros so we understand them
Last modified: 2005-10-07 16:08:26 UTC
This stuff in window.h can't be right, since recalc_window_features sets has_resize_func etc. based on maximized/fullscreen/etc. state. #define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->maximized && !(w)->fullscreen) #define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !(w)->maximized && !(w)->fullscreen && !(w)->shaded) #define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \ (((w)->size_hints.min_width < (w)->size_hints.max_width) || \ ((w)->size_hints.min_height < (w)->size_hints.max_height))) #define META_WINDOW_ALLOWS_HORIZONTAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_width < (w)->size_hints.max_width) #define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
Batch adding GNOME2 keyword to Metacity bugs. Sorry for the spam.
I've tried to make a patch. It isn't a definitive solution as it doesn't fix Bug 90420 but I don't know the code that well to fix that bug. For me it seems at least a bit cleaner and my point is that it won't block Bug 93586 anymore whose patch I want to get applied.
Created attachment 17168 [details] [review] Patch against metacity-2.5.2 cleans two macros in window.h up
Hmm, so I went through and tried to figure out what was hosed here. My code archaeology is: - the has_foo_func bitfields are supposed to be invariant regardless of window state; they indicate whether the window's nature allows that operation in general - the ALLOWS_FOO macros are supposed to indicate whether the function is *currently* allowed considering state such as fullscreen, maximized, and so forth. So what looks broken in the current code is the "if (window->fullscreen) { window->has_foo_func = FALSE; }" stuff in recalc_window_features(). However, as that code block exists, I bet there is broken code elsewhere that uses has_foo_func when it should be using the ALLOWS_FOO macros. Rob, this kind of mess is why I'm always so nitpicky about what functions are named, if you were getting frustrated about that. ;-) Anyway, perhaps we should rename some of this crap or otherwise clarify it, and then audit the usages of these various flags. Since I wrote the code and then clearly misunderstood it later on and wrote wrong code on top. Jürg, now that I understand this better maybe we can apply your other patch without having to add a patch here first, I'll have a look.
Hey - _I_ didn't write that. Don't try to foist this one off on me. cvsblame reveals that a mysterious cvs user going by "hp" checked those macros in for window.c revision 1.67. :-)
I know you didn't, I'm just pointing out that I get confused easily, even if I wrote the stuff. ;-)
Comment on attachment 17168 [details] [review] Patch against metacity-2.5.2 cleans two macros in window.h up This patch doesn't really address the bug at hand, I think.
Remove old target milestones on old bugs; sorry for the spam.