|
stekern
| Joined: 06 Dec 2007 |
| Posts: 1 |
|
|
 |
Posted: Tue Dec 11, 2007 11:03 pm |
|
 |
 |
 |
 |
Below is a patch that makes it possible to switch between fullscreen and non fullscreen mode by pressing alt+enter
included is also a fix that will make keys mapped with ae keyboard work
Index: development/wince/wince_window.c
===================================================================
--- development/wince/wince_window.c (revision 13)
+++ development/wince/wince_window.c (working copy)
@@ -108,8 +108,12 @@
static int reconfiguring = FALSE;
static char *window_name, *icon_name;
+static int isfullscreen = FALSE;
+static int menu_height = 0;
+static int scrollbar_width = 0;
+
+static void reset_window(int reinit);
void logevent(void *frontend, const char *string) { debug_level((DBG_FUNCTION, "log_event(%s);\n", string)); }
-void make_full_screen() { debug_level((DBG_FUNCTION, "make_full_screen();\n")); }
void set_busy_status(void *frontend, int status) { debug_level((DBG_FUNCTION, "set_busy_status();\n")); }
void frontend_keypress(void *handle) { debug_level((DBG_FUNCTION, "frontend_keypress();\n")); }
void set_iconic(void *frontend, int iconic) { debug_level((DBG_FUNCTION, "set_iconic();\n")); }
@@ -127,8 +131,6 @@
void dlg_fontsel_set(union control *ctrl, void *dlg, FontSpec fs) { debug_level((DBG_FUNCTION, "dlg_fontsel_set();\n")); }
void dlg_fontsel_get(union control *ctrl, void *dlg, FontSpec *fs) { debug_level((DBG_FUNCTION, "dlg_fontsel_get();\n")); }
int agent_exists(void) { debug_level((DBG_FUNCTION, "agent_exists();\n")); return FALSE; }
-void flip_full_screen() { debug_level((DBG_FUNCTION, "flip_full_screen();\n")); }
-int is_full_screen() { debug_level((DBG_FUNCTION, "is_fullscreen();\n")); return TRUE; }
int is_iconic(void *frontend) { debug_level((DBG_FUNCTION, "is_iconic();\n")); return FALSE; }
void notify_remote_exit(void *frontend) {
@@ -1685,7 +1687,65 @@
return ibuf;
}
+int is_full_screen() { debug_level((DBG_FUNCTION, "is_fullscreen();\n")); return isfullscreen; }
+void make_full_screen() {
+ RECT rc, rcMenuBar, cr;
+
+ debug_level((DBG_FUNCTION, "make_full_screen();\n"));
+ if (!hwnd)
+ return;
+
+ assert(IsZoomed(hwnd));
+
+ if (is_full_screen())
+ return;
+
+
+ GetWindowRect(hwnd, &rc);
+ GetWindowRect(hwndCB, &rcMenuBar);
+ GetClientRect(hwnd, &cr);
+
+ if (!cfg.scrollbar_in_fullscreen) {
+ /* put scrollbar outside screen if it is not desired in fullscreen */
+ scrollbar_width = (rc.right - cr.right);
+ }
+
+ menu_height = (rcMenuBar.bottom - rcMenuBar.top);
+ as_SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
+ ShowWindow(hwndCB, SW_HIDE);
+ MoveWindow( hwnd,
+ rc.left,
+ rc.top-menu_height,
+ rc.right+scrollbar_width,
+ rc.bottom+menu_height,
+ TRUE);
+
+ isfullscreen = TRUE;
+
+}
+void flip_full_screen() {
+ RECT rc;
+ GetWindowRect(hwnd, &rc);
+
+ debug_level((DBG_FUNCTION, "flip_full_screen();\n"));
+ if (is_full_screen()) {
+ as_SHFullScreen(hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON);
+ ShowWindow(hwndCB, SW_SHOW);
+
+ MoveWindow( hwnd,
+ rc.left,
+ rc.top+menu_height,
+ rc.right-scrollbar_width,
+ rc.bottom-(2*menu_height),
+ TRUE);
+ isfullscreen = FALSE;
+ } else {
+ make_full_screen();
+ }
+ reset_window(0);
+}
+
/*
* Translate a WM_(SYS)?KEY(UP|DOWN) message into a string of ASCII
* codes. Returns number of bytes used or zero to drop the message
@@ -1874,7 +1934,7 @@
if (compose_state > 1 && left_alt)
compose_state = 0;
-
+#if 0 /* this make arrow keys into numpad in screen on tytnII */
/* Sanitize the number pad if not using a PC NumPad */
if (left_alt || (term->app_keypad_keys && !cfg.no_applic_k
&& cfg.funky_type != FUNKY_XTERM)
@@ -1923,7 +1983,7 @@
}
}
}
-
+#endif
/* If a key is pressed and AltGr is not active */
if (key_down && (keystate[VK_RMENU] & 0x80) == 0 && !compose_state) {
/* Okay, prepare for most alts then ... */
@@ -1958,9 +2018,8 @@
SendMessage(hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0);
return -1;
}
- if (left_alt && wParam == VK_RETURN && cfg.fullscreenonaltenter &&
- (cfg.resize_action != RESIZE_DISABLED)) {
- if ((HIWORD(lParam) & (KF_UP | KF_REPEAT)) != KF_REPEAT)
+
+ if (left_alt && wParam == VK_RETURN ) {
flip_full_screen();
return -1;
}
@@ -3909,11 +3968,14 @@
break;
case WM_KEYUP:
debug_level((DBG_WMSG, "WM_KEYUP\n"));
- if (wParam == VK_CLEAR && lParam == 0xffffffff80000001) {
+ {
MSG m;
m.hwnd = hwnd;
m.message = WM_KEYDOWN;
- m.wParam = VK_SPACE;
+ if (wParam == VK_CLEAR && lParam == 0xffffffff80000001)
+ m.wParam = VK_SPACE;
+ else
+ m.wParam = wParam;
m.lParam = lParam & 0xdfff;
TranslateMessage(&m);
}
|
|