On Tue, May 15, 2012 at 02:23:57PM +0200, Michal Suchanek wrote: > On 15 May 2012 13:31, Peter Hutterer <[email protected]> wrote: > > On Tue, May 15, 2012 at 01:17:26PM +0200, Michal Suchanek wrote: > >> On 15 May 2012 12:38, Peter Hutterer <[email protected]> wrote: > >> > On Tue, May 15, 2012 at 12:18:36PM +0200, Michal Suchanek wrote: > >> >> Hello, > >> >> > >> >> On 15 May 2012 06:20, Peter Hutterer <[email protected]> wrote: > >> >> > On Mon, May 14, 2012 at 10:39:24AM -0700, Keith Packard wrote: > >> >> > >> >> >> diff --git a/dix/enterleave.h b/dix/enterleave.h > >> >> >> index 729059b..c937c0e 100644 > >> >> >> --- a/dix/enterleave.h > >> >> >> +++ b/dix/enterleave.h > >> >> >> @@ -60,9 +60,6 @@ extern void LeaveWindow(DeviceIntPtr dev); > >> >> >> extern void CoreFocusEvent(DeviceIntPtr kbd, > >> >> >> int type, int mode, int detail, > >> >> >> WindowPtr pWin); > >> >> >> > >> >> >> -extern void DeviceFocusEvent(DeviceIntPtr kbd, > >> >> >> - int type, int mode, int detail, > >> >> >> WindowPtr pWin); > >> >> >> - > >> >> >> extern void SetFocusIn(DeviceIntPtr kbd, WindowPtr win); > >> >> >> > >> >> >> extern void SetFocusOut(DeviceIntPtr dev); > >> >> > > >> >> > This hunk gives me > >> >> > > >> >> > enterleave.c: In function 'DeviceFocusOutEvents': > >> >> > enterleave.c:618:9: error: implicit declaration of function > >> >> > 'DeviceFocusEvent' [-Werror=implicit-function-declaration] > >> >> > enterleave.c:618:9: warning: nested extern declaration of > >> >> > 'DeviceFocusEvent' > >> >> > [-Wnested-externs] > >> >> > > >> >> > >> >> I did some compile tests but maybe this one slipped by. > >> >> > >> >> Just add this additional hunk. > >> > > >> > I think it'd be better to remove the DeviceFocusEvent() function from > >> > exevents.h and leave it in enterleave.h instead, including that header > >> > where > >> > needed. This way the focus/enter-leave functions are just in one header. > >> > >> You could argue that way for all exevents.h and exglobals.h declarations. > >> > >> Should these headers be removed? > > > > both of these ended up being catch-all headers, that's why they're so messy. > > there are few more dix headers that are similarly messy. > > better header discipline would be good but we're a few years too late for > > that and no-one has found the time to clean up yet. > > > >> On the other hand, that enterleave.c is a separate file that has its > >> own header is internal to the Xserver implementations and can change > >> in the future so you could argue that enterleave.h should be > >> abolished, too. > > > > enterleave.c is a relatively new file (2008?) and enterleave.h was an > > attempt to keep the enter/leave-related stuff confined so we don't have to > > shove everything into exglobals/exevents. > > > > towards smaller, more focused headers is the goal, not the other way round. > > > > Then you have the issue that you need the bazillions of these smaller, > more disciplined headers exported all throughout the X server and > randomly shove these headers into every other .c file.
There's a big step from smaller, more focused headers to bazilions of such headers. The key word here is "focused". In the enter/leave case, this code is only called from one file. It should simply have it its own header, included by that one file that actually needs it. > Specifically, Xi/exevents.c uses the DeviceFocusEvent but enterleave.h > is not available in Xi directory. http://patchwork.freedesktop.org/patch/10341/ sorry, forgot to add the cc to the patch before sending it out. Cheers, Peter _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
