1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
|
return FALSE;
if (keystate[VK_MENU] & 0x80)
return TRUE;
if (keystate[VK_RMENU] & 0x80)
return TRUE;
return FALSE;
}
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
HDC hdc;
static int ignore_clip = FALSE;
static int resizing = FALSE;
static int need_backend_resize = FALSE;
switch (message) {
case WM_TIMER:
if (pending_netevent)
enact_pending_netevent();
term_out();
|
>
>
<
|
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
|
return FALSE;
if (keystate[VK_MENU] & 0x80)
return TRUE;
if (keystate[VK_RMENU] & 0x80)
return TRUE;
return FALSE;
}
static int resizing;
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
HDC hdc;
static int ignore_clip = FALSE;
static int need_backend_resize = FALSE;
switch (message) {
case WM_TIMER:
if (pending_netevent)
enact_pending_netevent();
term_out();
|
4070
4071
4072
4073
4074
4075
4076
|
wp.showCmd = SW_SHOWNORMAL;
SetWindowPlacement(hwnd, &wp);
}
CheckMenuItem(GetSystemMenu(hwnd, FALSE), IDM_FULLSCREEN,
MF_BYCOMMAND| full_screen ? MF_CHECKED : MF_UNCHECKED);
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
|
wp.showCmd = SW_SHOWNORMAL;
SetWindowPlacement(hwnd, &wp);
}
CheckMenuItem(GetSystemMenu(hwnd, FALSE), IDM_FULLSCREEN,
MF_BYCOMMAND| full_screen ? MF_CHECKED : MF_UNCHECKED);
}
/*
* Minimise or restore the window in response to a server-side
* request.
*/
void set_iconic(int iconic)
{
if (IsIconic(hwnd)) {
if (!iconic)
ShowWindow(hwnd, SW_RESTORE);
} else {
if (iconic)
ShowWindow(hwnd, SW_MINIMIZE);
}
}
/*
* Move the window in response to a server-side request.
*/
void move_window(int x, int y)
{
SetWindowPos(hwnd, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}
/*
* Move the window to the top or bottom of the z-order in response
* to a server-side request.
*/
void set_zorder(int top)
{
if (cfg.alwaysontop || full_screen)
return; /* ignore */
SetWindowPos(hwnd, top ? HWND_TOP : HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE);
}
/*
* Refresh the window in response to a server-side request.
*/
void refresh_window(void)
{
InvalidateRect(hwnd, NULL, TRUE);
}
/*
* Maximise or restore the window in response to a server-side
* request.
*/
void set_zoomed(int zoomed)
{
if (IsZoomed(hwnd) || full_screen) {
if (!zoomed) {
if (full_screen)
flip_full_screen();
else
ShowWindow(hwnd, SW_RESTORE);
}
} else {
if (zoomed)
ShowWindow(hwnd, SW_MAXIMIZE);
}
}
/*
* Report whether the window is iconic, for terminal reports.
*/
int is_iconic(void)
{
return IsIconic(hwnd);
}
/*
* Report the window's position, for terminal reports.
*/
void get_window_pos(int *x, int *y)
{
RECT r;
GetWindowRect(hwnd, &r);
*x = r.left;
*y = r.top;
}
/*
* Report the window's pixel size, for terminal reports.
*/
void get_window_pixels(int *x, int *y)
{
RECT r;
GetWindowRect(hwnd, &r);
*x = r.right - r.left;
*y = r.bottom - r.top;
}
/*
* Return the window or icon title.
*/
char *get_window_title(int icon)
{
return icon ? icon_name : window_name;
}
|