Hello,
The mouse cursor works in all dialog box except in floppy select (Altgr+D) when Hatari is in FullScreen.
It works in widowed mode.
I test under my Linux X64 PC (Hatari 2.3.x package), I compil the 2.4.1 whith SDL2 2.27.0,
I also test on a Raspberry (compil Hatari 2.5.0-dev) same behavior.
I don't find information on this pb in the forum.
Is somebody has a idea on how to solve this?
Thank's in advance.
the mouse is disable in floppy select dialog when Hatari is in FullScreen
Moderators: simonsunnyboy, thothy, Moderator Team
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 3018
- Joined: Sun Jul 31, 2011 1:11 pm
Re: the mouse is disable in floppy select dialog when Hatari is in FullScreen
Thanks for reporting, I was able to reproduce it both with old Hatari v2.3.1 and latest Git version.
Mouse cursor is missing from SDL UI floppy selector only when it's invoked in fullscreen mode with a keyboard shortcut. It does not happen when floppy selector is invoked from windowed mode, or when in fullscreen, from Hatari "Floppy Disks" configuration UI.
I.e. until the issue is fixed, as a workaround, one can:
* Invoke floppy selector from windowed mode, or from configuration UI, or
* Use keyboard, or joystick to interact with the floppy selector instead of mouse
Mouse cursor is missing from SDL UI floppy selector only when it's invoked in fullscreen mode with a keyboard shortcut. It does not happen when floppy selector is invoked from windowed mode, or when in fullscreen, from Hatari "Floppy Disks" configuration UI.
I.e. until the issue is fixed, as a workaround, one can:
* Invoke floppy selector from windowed mode, or from configuration UI, or
* Use keyboard, or joystick to interact with the floppy selector instead of mouse
Re: the mouse is disable in floppy select dialog when Hatari is in FullScreen
I'm trying to find, it seems to be related to the RelativeMouseMode,
I share my experiences.
I'm adding the same code as DlgAlert_ShowDlg function to save and set the relative mode and at the end restore it, it seems to work. Thess actions are used in DlgAlert_ShowDlg and Dialog_MainDlg.
char* SDLGui_FileSelect(const char *title, const char *path_and_name, char **zip_path, bool bAllowNew)
{
struct dirent **files = NULL;
char *pStringMem;
char *retpath = NULL;
const char *home;
char *path, *fname; /* The actual file and path names */
bool reloaddir = true; /* Do we have to reload the directory file list? */
int retbut, len;
bool bOldMouseVisibility;
int selection; /* The selection index */
char *zipfilename; /* Filename in zip file */
char *zipdir;
bool browsingzip = false; /* Are we browsing an archive? */
zip_dir *zipfiles = NULL;
SDL_Event sdlEvent;
int yScrollbar_size; /* Size of the vertical scrollbar */
union {
char *mtxt;
const char *ctxt;
} dlgtitle; /* A hack to silent recent GCCs warnings */
dlgtitle.ctxt = title;
bool bOldMouseMode = SDL_GetRelativeMouseMode();
SDL_SetRelativeMouseMode(SDL_FALSE);
.
.
.
.
/* Allocate memory for the file and path name strings: */
pStringMem = malloc(4 * FILENAME_MAX);
if ( !pStringMem ){
SDL_SetRelativeMouseMode(bOldMouseMode);
return NULL;
}
path = pStringMem;
.
.
.
.
files_free(files);
free(pStringMem);
SDL_SetRelativeMouseMode(bOldMouseMode);
return retpath;
}
I share my experiences.
I'm adding the same code as DlgAlert_ShowDlg function to save and set the relative mode and at the end restore it, it seems to work. Thess actions are used in DlgAlert_ShowDlg and Dialog_MainDlg.
char* SDLGui_FileSelect(const char *title, const char *path_and_name, char **zip_path, bool bAllowNew)
{
struct dirent **files = NULL;
char *pStringMem;
char *retpath = NULL;
const char *home;
char *path, *fname; /* The actual file and path names */
bool reloaddir = true; /* Do we have to reload the directory file list? */
int retbut, len;
bool bOldMouseVisibility;
int selection; /* The selection index */
char *zipfilename; /* Filename in zip file */
char *zipdir;
bool browsingzip = false; /* Are we browsing an archive? */
zip_dir *zipfiles = NULL;
SDL_Event sdlEvent;
int yScrollbar_size; /* Size of the vertical scrollbar */
union {
char *mtxt;
const char *ctxt;
} dlgtitle; /* A hack to silent recent GCCs warnings */
dlgtitle.ctxt = title;
bool bOldMouseMode = SDL_GetRelativeMouseMode();
SDL_SetRelativeMouseMode(SDL_FALSE);
.
.
.
.
/* Allocate memory for the file and path name strings: */
pStringMem = malloc(4 * FILENAME_MAX);
if ( !pStringMem ){
SDL_SetRelativeMouseMode(bOldMouseMode);
return NULL;
}
path = pStringMem;
.
.
.
.
files_free(files);
free(pStringMem);
SDL_SetRelativeMouseMode(bOldMouseMode);
return retpath;
}
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 3018
- Joined: Sun Jul 31, 2011 1:11 pm
Re: the mouse is disable in floppy select dialog when Hatari is in FullScreen
Thanks for coming up with a fix and testing it!jmmparis wrote: ↑Mon Jan 30, 2023 10:07 pm I'm adding the same code as DlgAlert_ShowDlg function to save and set the relative mode and at the end restore it, it seems to work. These actions are used in DlgAlert_ShowDlg and Dialog_MainDlg.
char* SDLGui_FileSelect(const char *title, const char *path_and_name, char **zip_path, bool bAllowNew)
I decided to add that fix to ShortCut_InsertDisk() in in shortcut.c though: https://git.tuxfamily.org/hatari/hatari ... 375bbf9d73
Could you verify it?
Re: the mouse is disable in floppy select dialog when Hatari is in FullScreen
I've seen similar behavior when programming
has to do with the mouse form invoking it on or off during those routines
has to do with the mouse form invoking it on or off during those routines
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
Re: the mouse is disable in floppy select dialog when Hatari is in FullScreen
I test it, it works well.
Thanks for this quick feedback
Thanks for this quick feedback