diff --git a/xwords4/common/board.c b/xwords4/common/board.c index 203e807b9..90f893824 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -1366,8 +1366,7 @@ timerFiredForPen( BoardCtxt* board ) if ( listWords ) { util_cellSquareHeld( board->util, stream ); if ( dragDropInProgress( board ) ) { - XP_Bool dragged; - dragDropEnd( board, board->penDownX, board->penDownY, &dragged ); + dragDropEnd( board, board->penDownX, board->penDownY, NULL ); } } stream_destroy( stream ); @@ -3035,7 +3034,6 @@ handlePenUpInternal( BoardCtxt* board, XP_U16 xx, XP_U16 yy, XP_Bool isPen, XP_Bool altDown ) { XP_Bool draw = XP_FALSE; - XP_Bool dragged = XP_FALSE; BoardObjectType prevObj = board->penDownObject; /* prevent timer from firing after pen lifted. Set now rather than later @@ -3043,6 +3041,7 @@ handlePenUpInternal( BoardCtxt* board, XP_U16 xx, XP_U16 yy, XP_Bool isPen, exiting this function (which might give timer time to fire. */ board->penDownObject = OBJ_NONE; + XP_Bool dragged = XP_FALSE; if ( dragDropInProgress(board) ) { draw = dragDropEnd( board, xx, yy, &dragged ); } diff --git a/xwords4/common/dragdrpp.c b/xwords4/common/dragdrpp.c index 839124eac..28cd97d06 100644 --- a/xwords4/common/dragdrpp.c +++ b/xwords4/common/dragdrpp.c @@ -237,7 +237,7 @@ dragDropContinue( BoardCtxt* board, XP_U16 xx, XP_U16 yy ) } XP_Bool -dragDropEnd( BoardCtxt* board, XP_U16 xx, XP_U16 yy, XP_Bool* dragged ) +dragDropEnd( BoardCtxt* board, XP_U16 xx, XP_U16 yy, XP_Bool* draggedP ) { DragState* ds = &board->dragState; BoardObjectType newObj; @@ -245,7 +245,9 @@ dragDropEnd( BoardCtxt* board, XP_U16 xx, XP_U16 yy, XP_Bool* dragged ) XP_ASSERT( dragDropInProgress(board) ); (void)dragDropContinueImpl( board, xx, yy, &newObj ); - *dragged = ds->didMove; + if ( !!draggedP ) { + *draggedP = ds->didMove; + } /* If we've dropped on something, put the tile there! Since we don't remove it from its earlier location until it's dropped, diff --git a/xwords4/linux/gtkask.c b/xwords4/linux/gtkask.c index 792de08af..2da903ad4 100644 --- a/xwords4/linux/gtkask.c +++ b/xwords4/linux/gtkask.c @@ -48,18 +48,17 @@ gtkask( GtkWidget* parent, const gchar *message, GtkButtonsType buttons, gint gtkask_timeout( GtkWidget* parent, const gchar* message, GtkButtonsType buttons, const AskPair* buttxts, - XP_U16 timeout ) + uint32_t timeoutMS ) { - XP_LOGFF( "(msg: \"%s\")", message ); guint src = 0; GtkWidget* dlg = gtk_message_dialog_new( (GtkWindow*)parent, GTK_MESSAGE_QUESTION, GTK_DIALOG_MODAL, buttons, "%s", message ); - if ( timeout > 0 ) { - XP_LOGF( "%s(%s)", __func__, message ); /* log since times out... */ - src = g_timeout_add( timeout, timer_func, dlg ); + if ( timeoutMS > 0 ) { + XP_LOGF( "%s(\"%s\")", __func__, message ); /* log since times out... */ + src = g_timeout_add( timeoutMS, timer_func, dlg ); } while ( !!buttxts && !!buttxts->txt ) { diff --git a/xwords4/linux/gtkask.h b/xwords4/linux/gtkask.h index 32f8ccf63..20756b5c5 100644 --- a/xwords4/linux/gtkask.h +++ b/xwords4/linux/gtkask.h @@ -38,7 +38,7 @@ gint gtkask( GtkWidget* parent, const gchar *message, GtkButtonsType buttons, const AskPair* buttxts ); gint gtkask_timeout( GtkWidget* parent, const gchar *message, GtkButtonsType buttons, const AskPair* buttxts, - XP_U16 timeout ); + uint32_t timeoutMS ); #endif #endif /* PLATFORM_GTK */ diff --git a/xwords4/linux/gtkboard.c b/xwords4/linux/gtkboard.c index 552bfea79..68af06791 100644 --- a/xwords4/linux/gtkboard.c +++ b/xwords4/linux/gtkboard.c @@ -1961,9 +1961,10 @@ gtk_util_getTraySearchLimits( XW_UtilCtxt* XP_UNUSED(uc), static void gtk_util_bonusSquareHeld( XW_UtilCtxt* uc, XWBonusType bonus ) { - LOG_FUNC(); - XP_USE( uc ); - XP_USE( bonus ); + GtkGameGlobals* globals = (GtkGameGlobals*)uc->closure; + gchar* msg = g_strdup_printf( "bonusSquareHeld(bonus=%d)", bonus ); + gtkask_timeout( globals->window, msg, GTK_BUTTONS_OK, NULL, 1000 ); + g_free( msg ); } static void