mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
client: Report window format right for win32
This commit is contained in:
parent
1e4ec1f513
commit
fcbd3208fc
@ -348,6 +348,17 @@ void RedWindow_p::create(RedWindow& red_window, PixelsSource_p& pixels_source)
|
||||
}
|
||||
_win = window;
|
||||
pixels_source.dc = dc;
|
||||
|
||||
int depth = GetDeviceCaps(dc, BITSPIXEL);
|
||||
switch (depth) {
|
||||
case 16:
|
||||
_format = RedDrawable::RGB16_555;
|
||||
break;
|
||||
case 32:
|
||||
default:
|
||||
_format = RedDrawable::RGB32;
|
||||
break;
|
||||
}
|
||||
SetWindowLong(window, GWL_USERDATA, (LONG)&red_window);
|
||||
SetWindowLong(window, GWL_WNDPROC, (LONG)WindowProc);
|
||||
}
|
||||
@ -366,10 +377,7 @@ void RedWindow_p::destroy(PixelsSource_p& pixels_source)
|
||||
|
||||
RedDrawable::Format RedWindow::get_format()
|
||||
{
|
||||
/* TODO: Windows will convert types when
|
||||
blitting, so this works (and is what we did before).
|
||||
but it would be better to return the right format here */
|
||||
return RedDrawable::RGB32;
|
||||
return _format;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#define _H_RED_WINDOW_P
|
||||
|
||||
#include <map>
|
||||
#include <red_drawable.h>
|
||||
|
||||
class RedWindow;
|
||||
class Menu;
|
||||
@ -53,6 +54,7 @@ public:
|
||||
|
||||
protected:
|
||||
HWND _win;
|
||||
RedDrawable::Format _format;
|
||||
uint32_t _modal_refs;
|
||||
HMODULE _no_taskmgr_dll;
|
||||
HHOOK _no_taskmgr_hook;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user