mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-02-09 16:36:34 +00:00
Retire another global in favour of adding a feature to the
terminal.c interface. [originally from svn r2148]
This commit is contained in:
parent
4756c15fc9
commit
ea429ee71a
4
putty.h
4
putty.h
@ -92,8 +92,6 @@ typedef struct terminal_tag Terminal;
|
|||||||
#define ATTR_CUR_AND (~(ATTR_BOLD|ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS))
|
#define ATTR_CUR_AND (~(ATTR_BOLD|ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS))
|
||||||
#define ATTR_CUR_XOR 0x00BA0000UL
|
#define ATTR_CUR_XOR 0x00BA0000UL
|
||||||
|
|
||||||
GLOBAL int alt_pressed;
|
|
||||||
|
|
||||||
GLOBAL int session_closed;
|
GLOBAL int session_closed;
|
||||||
|
|
||||||
GLOBAL int nsessions;
|
GLOBAL int nsessions;
|
||||||
@ -458,7 +456,7 @@ void registry_cleanup(void);
|
|||||||
Terminal *term_init(void *frontend);
|
Terminal *term_init(void *frontend);
|
||||||
void term_size(Terminal *, int, int, int);
|
void term_size(Terminal *, int, int, int);
|
||||||
void term_out(Terminal *);
|
void term_out(Terminal *);
|
||||||
void term_paint(Terminal *, Context, int, int, int, int);
|
void term_paint(Terminal *, Context, int, int, int, int, int);
|
||||||
void term_scroll(Terminal *, int, int);
|
void term_scroll(Terminal *, int, int);
|
||||||
void term_pwron(Terminal *);
|
void term_pwron(Terminal *);
|
||||||
void term_clrsb(Terminal *);
|
void term_clrsb(Terminal *);
|
||||||
|
@ -3106,7 +3106,7 @@ void term_invalidate(Terminal *term)
|
|||||||
* Paint the window in response to a WM_PAINT message.
|
* Paint the window in response to a WM_PAINT message.
|
||||||
*/
|
*/
|
||||||
void term_paint(Terminal *term, Context ctx,
|
void term_paint(Terminal *term, Context ctx,
|
||||||
int left, int top, int right, int bottom)
|
int left, int top, int right, int bottom, int immediately)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
if (left < 0) left = 0;
|
if (left < 0) left = 0;
|
||||||
@ -3128,7 +3128,7 @@ void term_paint(Terminal *term, Context ctx,
|
|||||||
* fails to actually do anything when re-sizing ... painting the wrong
|
* fails to actually do anything when re-sizing ... painting the wrong
|
||||||
* window perhaps ?
|
* window perhaps ?
|
||||||
*/
|
*/
|
||||||
if (alt_pressed)
|
if (immediately)
|
||||||
do_paint (term, ctx, FALSE);
|
do_paint (term, ctx, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
11
window.c
11
window.c
@ -2082,7 +2082,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
(p.rcPaint.left-offset_width)/font_width,
|
(p.rcPaint.left-offset_width)/font_width,
|
||||||
(p.rcPaint.top-offset_height)/font_height,
|
(p.rcPaint.top-offset_height)/font_height,
|
||||||
(p.rcPaint.right-offset_width-1)/font_width,
|
(p.rcPaint.right-offset_width-1)/font_width,
|
||||||
(p.rcPaint.bottom-offset_height-1)/font_height);
|
(p.rcPaint.bottom-offset_height-1)/font_height,
|
||||||
|
is_alt_pressed());
|
||||||
|
|
||||||
if (p.fErase ||
|
if (p.fErase ||
|
||||||
p.rcPaint.left < offset_width ||
|
p.rcPaint.left < offset_width ||
|
||||||
@ -2189,7 +2190,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
* 1) Keep the sizetip uptodate
|
* 1) Keep the sizetip uptodate
|
||||||
* 2) Make sure the window size is _stepped_ in units of the font size.
|
* 2) Make sure the window size is _stepped_ in units of the font size.
|
||||||
*/
|
*/
|
||||||
if (cfg.resize_action != RESIZE_FONT && !alt_pressed) {
|
if (cfg.resize_action != RESIZE_FONT && !is_alt_pressed()) {
|
||||||
int width, height, w, h, ew, eh;
|
int width, height, w, h, ew, eh;
|
||||||
LPRECT r = (LPRECT) lParam;
|
LPRECT r = (LPRECT) lParam;
|
||||||
|
|
||||||
@ -2350,7 +2351,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
* down the connection during an NT opaque drag.)
|
* down the connection during an NT opaque drag.)
|
||||||
*/
|
*/
|
||||||
if (resizing) {
|
if (resizing) {
|
||||||
if (cfg.resize_action != RESIZE_FONT && !alt_pressed) {
|
if (cfg.resize_action != RESIZE_FONT && !is_alt_pressed()) {
|
||||||
need_backend_resize = TRUE;
|
need_backend_resize = TRUE;
|
||||||
w = (width-cfg.window_border*2) / font_width;
|
w = (width-cfg.window_border*2) / font_width;
|
||||||
if (w < 1) w = 1;
|
if (w < 1) w = 1;
|
||||||
@ -2554,7 +2555,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if (message == wm_mousewheel || message == WM_MOUSEWHEEL) {
|
if (message == wm_mousewheel || message == WM_MOUSEWHEEL) {
|
||||||
int shift_pressed=0, control_pressed=0, alt_pressed=0;
|
int shift_pressed=0, control_pressed=0;
|
||||||
|
|
||||||
if (message == WM_MOUSEWHEEL) {
|
if (message == WM_MOUSEWHEEL) {
|
||||||
wheel_accumulator += (short)HIWORD(wParam);
|
wheel_accumulator += (short)HIWORD(wParam);
|
||||||
@ -3188,8 +3189,6 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
alt_pressed = (left_alt && key_down);
|
|
||||||
|
|
||||||
scan = (HIWORD(lParam) & (KF_UP | KF_EXTENDED | 0xFF));
|
scan = (HIWORD(lParam) & (KF_UP | KF_EXTENDED | 0xFF));
|
||||||
shift_state = ((keystate[VK_SHIFT] & 0x80) != 0)
|
shift_state = ((keystate[VK_SHIFT] & 0x80) != 0)
|
||||||
+ ((keystate[VK_CONTROL] & 0x80) != 0) * 2;
|
+ ((keystate[VK_CONTROL] & 0x80) != 0) * 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user