mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-06 18:31:57 +08:00
tune code for change of init operation of _DESKTOPOPS; use GetSystemBitmapEx2 instead of GetSystemBitmapEx; add a new desktop message MSG_REINITDESKOPS
This commit is contained in:
@@ -2331,8 +2331,8 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
|
||||
hDesktopDC = GetDC (HWND_DESKTOP);
|
||||
|
||||
dsk_ops = &def_dsk_ops;
|
||||
if(dsk_ops->init)
|
||||
dt_context = dsk_ops->init();
|
||||
if (dsk_ops->init)
|
||||
dt_context = dsk_ops->init (hDesktopDC);
|
||||
#ifdef _MGHAVE_MENU
|
||||
sg_DesktopMenu = dskCreateDesktopMenu ();
|
||||
#endif
|
||||
@@ -2354,6 +2354,13 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
|
||||
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, 0);
|
||||
break;
|
||||
|
||||
case MSG_REINITDESKOPS:
|
||||
if (dsk_ops->init) {
|
||||
dt_context = dsk_ops->init (hDesktopDC);
|
||||
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case MSG_ENDSESSION:
|
||||
__mg_screensaver_destroy ();
|
||||
|
||||
|
||||
@@ -4377,8 +4377,8 @@ static int srvSesseionMessageHandler (int message, WPARAM wParam, LPARAM lParam)
|
||||
__mg_init_local_sys_text ();
|
||||
hDesktopDC = GetDC (HWND_DESKTOP);
|
||||
|
||||
if(dsk_ops->init)
|
||||
dt_context = dsk_ops->init();
|
||||
if (dsk_ops->init)
|
||||
dt_context = dsk_ops->init (hDesktopDC);
|
||||
#ifdef _MGHAVE_MENU
|
||||
sg_DesktopMenu = srvCreateDesktopMenu ();
|
||||
#endif
|
||||
@@ -4394,6 +4394,13 @@ static int srvSesseionMessageHandler (int message, WPARAM wParam, LPARAM lParam)
|
||||
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, 0);
|
||||
break;
|
||||
|
||||
case MSG_REINITDESKOPS:
|
||||
if (dsk_ops->init) {
|
||||
dt_context = dsk_ops->init (hDesktopDC);
|
||||
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case MSG_ENDSESSION:
|
||||
if (SERVER_HAS_NO_MAINWINDOW()) {
|
||||
__mg_screensaver_destroy();
|
||||
|
||||
@@ -4145,9 +4145,9 @@ static int dskGetBgPicturePos (void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static PBITMAP dskLoadBgPicture (void)
|
||||
static PBITMAP dskLoadBgPicture (HDC hdc)
|
||||
{
|
||||
return (PBITMAP)GetSystemBitmapEx (__mg_def_renderer->name,
|
||||
return (PBITMAP)GetSystemBitmapEx2 (hdc, __mg_def_renderer->name,
|
||||
SYSBMP_BGPICTURE);
|
||||
}
|
||||
|
||||
@@ -4197,7 +4197,7 @@ static void dskGetBgPictureXY (int pos, int w, int h, int* x, int* y)
|
||||
}
|
||||
}
|
||||
|
||||
static void* def_init(void)
|
||||
static void* def_init (HDC dc_desktop)
|
||||
{
|
||||
PBITMAP bg_bmp = NULL;
|
||||
int pic_x = 0, pic_y = 0;
|
||||
@@ -4214,7 +4214,7 @@ static void* def_init(void)
|
||||
if (pos < 0)
|
||||
bg_bmp = NULL;
|
||||
else
|
||||
bg_bmp = dskLoadBgPicture ();
|
||||
bg_bmp = dskLoadBgPicture (dc_desktop);
|
||||
|
||||
if (bg_bmp)
|
||||
dskGetBgPictureXY (pos,
|
||||
@@ -4250,18 +4250,14 @@ DESKTOPOPS* GUIAPI SetCustomDesktopOperationSet (DESKTOPOPS* usr_dsk_ops)
|
||||
}
|
||||
|
||||
if (dsk_ops->deinit) {
|
||||
dsk_ops->deinit(dt_context);
|
||||
}
|
||||
|
||||
if (usr_dsk_ops->init) {
|
||||
dt_context = usr_dsk_ops->init();
|
||||
dsk_ops->deinit (dt_context);
|
||||
}
|
||||
|
||||
tmp_ops = dsk_ops;
|
||||
dsk_ops = usr_dsk_ops;
|
||||
|
||||
SendMessage(HWND_DESKTOP, MSG_ERASEDESKTOP, 0, 0);
|
||||
|
||||
/* Since 5.0.0 */
|
||||
SendMessage (HWND_DESKTOP, MSG_REINITDESKOPS, 0, 0);
|
||||
return tmp_ops;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user