[teklib-general] teklib: Display_DFB: fixed input message spooling, fixed crash w...

Timm S. Mueller tmueller at neoscientists.org
Thu May 15 21:52:59 CEST 2008


details:   http://hg.teklib.org/teklib/rev/91c68b6dee31
changeset: 192:91c68b6dee31
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Thu May 15 19:08:14 2008 +0200
description:
Display_DFB: fixed input message spooling, fixed crash when no visual was
opened, added MOUSEMOVE event processing; Display_X11: Merged minor changes in
font property handling, memory leak in input handling and some symbol name
changes from tekUI

diffs (truncated from 347 to 100 lines):

diff -r fb85abe36133 -r 91c68b6dee31 src/display_dfb/display_dfb_mod.c
--- a/src/display_dfb/display_dfb_mod.c	Thu May 15 17:23:05 2008 +0200
+++ b/src/display_dfb/display_dfb_mod.c	Thu May 15 19:08:14 2008 +0200
@@ -520,9 +520,6 @@ dfb_taskfunc(TAPTR task)
 			{
 				/* process input messages: */
 				dfb_processevent(inst);
-				/* send out input messages to owners: */
-				dfb_sendimessages(inst, do_interval);
-
 			}
 		}
 
@@ -541,31 +538,36 @@ dfb_taskfunc(TAPTR task)
 			}
 		}
 
+		/* send out input messages to owners: */
+		dfb_sendimessages(inst, do_interval);
+
 		v = (VISUAL *) TFIRSTNODE(&inst->dfb_vlist);
-
-		if (v->oldmousex != v->mousex || v->oldmousey != v->mousey)
-		{
-			DFBRectangle rect = { v->mousex, v->mousey, inst->dfb_CursorWidth,
-								  inst->dfb_CursorHeight };
-			/* restore backup */
-			v->primary->Blit(v->primary, v->backup, NULL, v->oldmousex, v->oldmousey);
-
-			/* save new covered area */
-			v->backup->Blit(v->backup, v->primary, &rect, 0, 0);
-			v->backup_valid = TTRUE;
-			v->cursor_valid = TFALSE;
-		}
-
-		/* debug
-		v->primary->Blit(v->primary, v->backup, NULL, 50, 500);
-		*/
-
-		if (v->cursor_valid == TFALSE) /* draw cursor */
-			v->primary->Blit(v->primary, inst->dfb_CursorSurface, NULL, v->mousex, v->mousey);
-
-		/* save mouse position */
-		v->oldmousex = v->mousex;
-		v->oldmousey = v->mousey;
+		if (v)
+		{
+			if (v->oldmousex != v->mousex || v->oldmousey != v->mousey)
+			{
+				DFBRectangle rect = { v->mousex, v->mousey, inst->dfb_CursorWidth,
+									inst->dfb_CursorHeight };
+				/* restore backup */
+				v->primary->Blit(v->primary, v->backup, NULL, v->oldmousex, v->oldmousey);
+
+				/* save new covered area */
+				v->backup->Blit(v->backup, v->primary, &rect, 0, 0);
+				v->backup_valid = TTRUE;
+				v->cursor_valid = TFALSE;
+			}
+
+			/* debug
+			v->primary->Blit(v->primary, v->backup, NULL, 50, 500);
+			*/
+
+			if (v->cursor_valid == TFALSE) /* draw cursor */
+				v->primary->Blit(v->primary, inst->dfb_CursorSurface, NULL, v->mousex, v->mousey);
+
+			/* save mouse position */
+			v->oldmousex = v->mousex;
+			v->oldmousey = v->mousey;
+		}
 
 		/* get signal state: */
 		sig = TExecSetSignal(inst->dfb_ExecBase, 0, TTASK_SIG_ABORT);
@@ -660,6 +662,15 @@ dfb_processvisualevent(TMOD_DFB *mod, VI
 			break;
 		case DIET_AXISMOTION:
 			getmousepos(mod, v, ev);
+			if (v->eventmask & TITYPE_MOUSEMOVE)
+			{
+				if (getimsg(mod, v, &imsg, TITYPE_MOUSEMOVE))
+				{
+					imsg->timsg_MouseX = v->mousex;
+					imsg->timsg_MouseY = v->mousey;
+					TAddTail(&v->imsgqueue, &imsg->timsg_Node);
+				}
+			}
 			break;
 		case DIET_BUTTONPRESS:
 		case DIET_BUTTONRELEASE:
diff -r fb85abe36133 -r 91c68b6dee31 src/display_x11/display_x11_font.c
--- a/src/display_x11/display_x11_font.c	Thu May 15 17:23:05 2008 +0200
+++ b/src/display_x11/display_x11_font.c	Thu May 15 19:08:14 2008 +0200
@@ -1465,91 +1465,81 @@ x11_hostgetfattrfunc(struct THook *hook,
 			return TTRUE;
 
 		case TVisual_FontPxSize:
-			*((TINT *) item->tti_Value) = fn->pxsize;
+			*((TTAG *) item->tti_Value) = fn->pxsize;
 			break;


More information about the teklib-general mailing list