Ticket #554: mbitter.fullscreen.patch

File mbitter.fullscreen.patch, 2.8 KB (added by thomas0782, 10 years ago)
  • navit/graphics/win32/graphics_win32.c

     
    2020#include "profile.h"
    2121#include "keys.h"
    2222
     23#ifdef HAVE_API_WIN32_CE
     24#include <aygshell.h>
     25#endif
     26
    2327//#define FAST_TRANSPARENCY 1
    2428
    2529typedef BOOL (WINAPI *FP_AlphaBlend) ( HDC hdcDest,
     
    529523{
    530524
    531525#ifdef HAVE_API_WIN32_CE
    532     HWND hwndTaskbar = FindWindow(L"HHTaskBar", NULL);
    533     HWND hwndSip = FindWindow(L"MS_SIPBUTTON", NULL);
    534         if (on) {
    535         ShowWindow(hwndTaskbar, SW_HIDE);
    536         MoveWindow(g_hwnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), FALSE);
    537        
    538         // deactivate the SIP button
    539         ShowWindow(hwndSip, SW_HIDE);
    540        
    541         } else {
    542         ShowWindow(hwndTaskbar, SW_SHOW);
    543         RECT taskbar_rect;
    544         GetWindowRect(  hwndTaskbar, &taskbar_rect);
    545         MoveWindow(g_hwnd, 0, taskbar_rect.bottom, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN) - taskbar_rect.bottom, FALSE);
    546    
    547         // activate the SIP button
    548         ShowWindow(hwndSip, SW_SHOW);
     526    // From the MSDN example at http://msdn.microsoft.com/en-us/library/aa930139.aspx
     527    DWORD dwState;
     528    RECT rc;
     529 
     530    if (on) {
     531      // To switch to full screen mode, first hide all of the shell parts.
     532      dwState = (SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
     533      SHFullScreen(g_hwnd, dwState);
     534      // Next resize the main window to the size of the screen.
     535      SetRect(&rc, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
     536      MoveWindow(g_hwnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE);
     537    } else {
     538      // To switch to normal mode, first show all of the shell parts.
     539      dwState = (SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
     540      SHFullScreen(g_hwnd, dwState);
     541      // Next resize the main window to the size of the work area.
     542      SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, FALSE);
     543      MoveWindow(g_hwnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE);
    549544    }
    550545
    551546#else
    552         if (on) {
    553         ShowWindow(g_hwnd, SW_MAXIMIZE);
    554         } else {
    555         ShowWindow(g_hwnd, SW_RESTORE);
     547    if (on) {
     548      ShowWindow(g_hwnd, SW_MAXIMIZE);
     549    } else {
     550      ShowWindow(g_hwnd, SW_RESTORE);
    556551    }
    557552
    558553#endif
    559 
    560554    return 0;
    561555}
    562556
  • navit/Makefile.am

     
     static GList *timers;
     
    126126if SUPPORT_WIN32
    127127  navit_LDADD += resource.rsc
    128128if SUPPORT_WIN32CE
    129   navit_LDADD += -lcommctrl -Lsupport/libc
     129  navit_LDADD += -lcommctrl -laygshell -Lsupport/libc
    130130else
    131131  navit_LDADD += -lgdi32 -lcomctl32 -lwinmm
    132132endif