mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
Debugger: Well, pdcurses resize events don't actually update the reported console size, so we have to hack around to read what Windows told pdcurses the new console size is.
This commit is contained in:
@@ -2852,6 +2852,10 @@ void win_code_ui_up(int count) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
extern "C" INPUT_RECORD * _pdcurses_hax_inputrecord(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
Bit32u DEBUG_CheckKeys(void) {
|
Bit32u DEBUG_CheckKeys(void) {
|
||||||
Bits ret=0;
|
Bits ret=0;
|
||||||
bool numberrun = false;
|
bool numberrun = false;
|
||||||
@@ -2861,11 +2865,19 @@ Bit32u DEBUG_CheckKeys(void) {
|
|||||||
/* FIXME: This is supported by PDcurses, except I cannot figure out how to trigger it.
|
/* FIXME: This is supported by PDcurses, except I cannot figure out how to trigger it.
|
||||||
The Windows console resizes around the console set by pdcurses and does not notify us as far as I can tell. */
|
The Windows console resizes around the console set by pdcurses and does not notify us as far as I can tell. */
|
||||||
if (key == KEY_RESIZE) {
|
if (key == KEY_RESIZE) {
|
||||||
#ifdef WIN32 /* pdcurses needs a little more work here to work properly in Windows.
|
#ifdef WIN32 /* BUG: pdcurses notifies us immediately upon getting a resize event but does not update it's
|
||||||
Note that not calling resize_term() prevents pdcurses from sending any more resize events. */
|
internal structures to reflect the new console size. For example a Win32 console event
|
||||||
if (dbg.win_main) {
|
reporting a change to 80x41 would still return 80x40 if we asked pdcurses right now.
|
||||||
int win_main_maxy, win_main_maxx; getmaxyx(dbg.win_main, win_main_maxy, win_main_maxx);
|
To make resizing the console window less painful, look at pdcurses internal structure
|
||||||
resize_term(win_main_maxy,win_main_maxx);
|
directly instead.
|
||||||
|
|
||||||
|
Note that we need to call resize_term() or pdcurses will never notify us about console
|
||||||
|
resize again. */
|
||||||
|
{
|
||||||
|
INPUT_RECORD *r = _pdcurses_hax_inputrecord();
|
||||||
|
if (r->EventType == WINDOW_BUFFER_SIZE_EVENT) {
|
||||||
|
resize_term(r->Event.WindowBufferSizeEvent.dwSize.Y, r->Event.WindowBufferSizeEvent.dwSize.X);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
void DEBUG_GUI_OnResize(void);
|
void DEBUG_GUI_OnResize(void);
|
||||||
|
@@ -34,6 +34,11 @@ static SHORT left_key;
|
|||||||
static int key_count = 0;
|
static int key_count = 0;
|
||||||
static int save_press = 0;
|
static int save_press = 0;
|
||||||
|
|
||||||
|
/* HACK! */
|
||||||
|
INPUT_RECORD* _pdcurses_hax_inputrecord(void) {
|
||||||
|
return &save_ip;
|
||||||
|
}
|
||||||
|
|
||||||
#define KEV save_ip.Event.KeyEvent
|
#define KEV save_ip.Event.KeyEvent
|
||||||
#define MEV save_ip.Event.MouseEvent
|
#define MEV save_ip.Event.MouseEvent
|
||||||
#define REV save_ip.Event.WindowBufferSizeEvent
|
#define REV save_ip.Event.WindowBufferSizeEvent
|
||||||
|
Reference in New Issue
Block a user