summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-04-27 14:20:00 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-04-27 14:20:00 +0000
commit5e2bc7d1c04a516dce19f91993ef83a743ac0a3f (patch)
tree3afaf9942a2d70d2765999f958fa95b7e53b027d
parent1f9c75b3e56e1efdf114393c221fe9ef8f2cab05 (diff)
Remove XFree86 tags.
Add 'notifyFocus' mechanism for drivers that want to shut down to some extent when client apps aren't mapped.
-rw-r--r--src/miniglx/dispatch.c2
-rw-r--r--src/miniglx/dri_util.c2
-rw-r--r--src/miniglx/dri_util.h2
-rw-r--r--src/miniglx/miniglxP.h7
-rw-r--r--src/miniglx/miniglx_events.c25
-rw-r--r--src/miniglx/sarea.h2
-rw-r--r--src/miniglx/xf86drm.c2
-rw-r--r--src/miniglx/xf86drm.h2
8 files changed, 16 insertions, 28 deletions
diff --git a/src/miniglx/dispatch.c b/src/miniglx/dispatch.c
index a367583afe..a83f20a281 100644
--- a/src/miniglx/dispatch.c
+++ b/src/miniglx/dispatch.c
@@ -34,8 +34,6 @@
*
*/
-/* $XFree86: xc/lib/GL/glx/dispatch.c,v 1.4 2002/02/22 21:32:53 dawes Exp $ */
-
#include <GL/gl.h>
#include "glapi.h"
#include "glapitable.h"
diff --git a/src/miniglx/dri_util.c b/src/miniglx/dri_util.c
index e8cad64d49..9d126bd030 100644
--- a/src/miniglx/dri_util.c
+++ b/src/miniglx/dri_util.c
@@ -675,7 +675,7 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
if (dpy->IsClient) {
/*
- * Map the framebuffer region.
+ * Map the framebuffer region.
*/
if (drmMap(psp->fd, dpy->driverContext.shared.hFrameBuffer, psp->fbSize,
(drmAddressPtr)&psp->pFB)) {
diff --git a/src/miniglx/dri_util.h b/src/miniglx/dri_util.h
index 6ba758a295..b7c22a3e77 100644
--- a/src/miniglx/dri_util.h
+++ b/src/miniglx/dri_util.h
@@ -42,8 +42,6 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86$ */
-
#ifndef _DRI_UTIL_H_
#define _DRI_UTIL_H_
diff --git a/src/miniglx/miniglxP.h b/src/miniglx/miniglxP.h
index 439d44adfe..0049a8a9a1 100644
--- a/src/miniglx/miniglxP.h
+++ b/src/miniglx/miniglxP.h
@@ -278,6 +278,12 @@ struct DRIDriverRec {
* \brief Restore hardware state after regaining the vt.
*/
int (*restoreHardware)( struct DRIDriverContextRec *dpy );
+
+ /**
+ * \brief Notify hardware driver of gain/loose focus. May be zero
+ * as this is of limited utility for most drivers.
+ */
+ void (*notifyFocus)( int have_focus );
};
@@ -453,7 +459,6 @@ extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn);
extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
-extern void __miniglx_release_vt( void );
extern int __miniglx_open_connections( Display *dpy );
extern void __miniglx_close_connections( Display *dpy );
diff --git a/src/miniglx/miniglx_events.c b/src/miniglx/miniglx_events.c
index afdbadeb08..dd53fc14b0 100644
--- a/src/miniglx/miniglx_events.c
+++ b/src/miniglx/miniglx_events.c
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $Id: miniglx_events.c,v 1.1.2.7 2003/04/26 21:17:47 keithw Exp $ */
+/* $Id: miniglx_events.c,v 1.1.2.8 2003/04/27 14:20:00 keithw Exp $ */
/**
@@ -144,7 +144,6 @@ static int send_msg( Display *dpy, int i,
return False;
}
-/* fprintf(stderr, "send %d bytes to %d\n", sz, i); */
memcpy( dpy->fd[i].writebuf + cnt, msg, sz ); cnt += sz;
dpy->fd[i].writebuf_count = cnt;
return True;
@@ -272,7 +271,6 @@ handle_fifo_read( Display *dpy, int i )
switch (id) {
/* The server has called 'XMapWindow' on a client window */
case _YouveGotFocus:
-/* fprintf(stderr, "_YouveGotFocus\n"); */
er = queue_event(dpy);
if (!er) return False;
er->xmap.type = MapNotify;
@@ -282,12 +280,13 @@ handle_fifo_read( Display *dpy, int i )
er->xmap.event = dpy->TheWindow;
er->xmap.window = dpy->TheWindow;
er->xmap.override_redirect = False;
+ if (dpy->driver->notifyFocus)
+ dpy->driver->notifyFocus( 1 );
break;
/* The server has called 'XMapWindow' or 'X???' on a client
* window */
case _RepaintPlease:
-/* fprintf(stderr, "_RepaintPlease\n"); */
er = queue_event(dpy);
if (!er) return False;
er->xexpose.type = Expose;
@@ -316,7 +315,6 @@ handle_fifo_read( Display *dpy, int i )
* server does).
*/
case _YouveLostFocus:
-/* fprintf(stderr, "_YouveLostFocus\n"); */
er = queue_event(dpy);
if (!er) return False;
er->xunmap.type = UnmapNotify;
@@ -326,6 +324,8 @@ handle_fifo_read( Display *dpy, int i )
er->xunmap.event = dpy->TheWindow;
er->xunmap.window = dpy->TheWindow;
er->xunmap.from_configure = False;
+ if (dpy->driver->notifyFocus)
+ dpy->driver->notifyFocus( 0 );
break;
default:
@@ -340,7 +340,6 @@ handle_fifo_read( Display *dpy, int i )
* (having called 'XMapWindow' locally).
*/
case _CanIHaveFocus:
-/* fprintf(stderr, "_CanIHaveFocus\n"); */
er = queue_event(dpy);
if (!er) return False;
er->xmaprequest.type = MapRequest;
@@ -349,7 +348,6 @@ handle_fifo_read( Display *dpy, int i )
er->xmaprequest.display = dpy;
er->xmaprequest.parent = 0;
er->xmaprequest.window = (Window)i;
- fprintf(stderr, "queued MapRequest\n");
break;
/* Both _YouveLostFocus and _IDontWantFocus generate unmap
@@ -359,7 +357,6 @@ handle_fifo_read( Display *dpy, int i )
* unmapped its own window.
*/
case _IDontWantFocus:
-/* fprintf(stderr, "_IDontWantFocus\n"); */
er = queue_event(dpy);
if (!er) return False;
er->xunmap.type = UnmapNotify;
@@ -381,11 +378,6 @@ handle_fifo_read( Display *dpy, int i )
dpy->fd[i].readbuf_count -= count;
if (dpy->fd[i].readbuf_count) {
-/* fprintf(stderr, "count: %d memmove %p %p %d\n", count, */
-/* dpy->fd[i].readbuf, */
-/* dpy->fd[i].readbuf + count, */
-/* dpy->fd[i].readbuf_count); */
-
memmove(dpy->fd[i].readbuf,
dpy->fd[i].readbuf + count,
dpy->fd[i].readbuf_count);
@@ -481,8 +473,11 @@ __miniglx_Select( Display *dpy, int n, fd_set *rfds, fd_set *wfds, fd_set *xfds,
errno = tmp;
}
- if (retval < 0)
+ if (retval < 0) {
+ FD_ZERO(rfds);
+ FD_ZERO(wfds);
return retval;
+ }
/* Handle server fd[0] specially:
*/
@@ -644,8 +639,6 @@ void __miniglx_close_connections( Display *dpy )
static void set_drawable_flag( Display *dpy, int w, int flag )
{
- fprintf(stderr, "%s %d %d\n", __FUNCTION__, w, flag);
-
if (dpy->driverContext.pSAREA) {
DRM_LIGHT_LOCK( dpy->driverContext.drmFD,
dpy->driverContext.pSAREA,
diff --git a/src/miniglx/sarea.h b/src/miniglx/sarea.h
index fd420aa082..89de065b8a 100644
--- a/src/miniglx/sarea.h
+++ b/src/miniglx/sarea.h
@@ -31,8 +31,6 @@
* \author Rickard E. (Rik) Faith <faith@valinux.com>
*/
-/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.10 2001/10/04 18:28:20 alanh Exp $ */
-
#ifndef _SAREA_H_
#define _SAREA_H_
diff --git a/src/miniglx/xf86drm.c b/src/miniglx/xf86drm.c
index d976afa2d4..078a8025eb 100644
--- a/src/miniglx/xf86drm.c
+++ b/src/miniglx/xf86drm.c
@@ -31,8 +31,6 @@
* \author Kevin E. Martin <martin@valinux.com>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.28 2002/10/16 01:26:49 dawes Exp $ */
-
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
diff --git a/src/miniglx/xf86drm.h b/src/miniglx/xf86drm.h
index 0169d89c28..dc92f32837 100644
--- a/src/miniglx/xf86drm.h
+++ b/src/miniglx/xf86drm.h
@@ -30,8 +30,6 @@
* \author Rickard E. (Rik) Faith <faith@valinux.com>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.17 2002/10/16 01:26:48 dawes Exp $ */
-
#ifndef _XF86DRM_H_
#define _XF86DRM_H_