1.5.0 Seamless and Compiz

Discussions related to using VirtualBox on Linux hosts.

Postby kv11111 » 15. Sep 2007, 09:07

I've written the following little program that creates invisible window and fixes issue with compiz. For some strange reason when I'm trying to make it not appear on taskbar it stop working.

You can compile the code on linux host using mingw32 cross compiler:

$ i586-mingw32msvc-gcc -mwindows cfix.c -o cfix.exe

Code: Select all   Expand viewCollapse view
#include <windows.h>

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

/*  WinMain(), our entry point  */
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   LPSTR szCmdLine, int iCmdShow)
{

    static char szAppName[] = "cfix";
    HWND        hwnd;
    MSG         msg;
    WNDCLASSEX  wndclass;

    memset(&wndclass, 0, sizeof(wndclass));

    /*  Fill in WNDCLASSEX struct members  */
    wndclass.cbSize         = sizeof(wndclass);
    wndclass.style          = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc    = WndProc;
    wndclass.cbClsExtra     = 0;
    wndclass.cbWndExtra     = 0;
    wndclass.hInstance      = hInstance;
    wndclass.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hIconSm        = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wndclass.hbrBackground  = (HBRUSH) GetStockObject(BLACK_BRUSH);
    wndclass.lpszClassName  = szAppName;
    wndclass.lpszMenuName   = NULL;

   
    /*  Register a new window class with Windows  */
    RegisterClassEx(&wndclass);

    /*  Create a window based on our new class  */
    hwnd = CreateWindow(szAppName, szAppName,
                        0,
                        -10,-10,
                        1,1,
                        NULL, NULL, hInstance, NULL);

    //SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_TOOLWINDOW);
    //SetWindowLongA( hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_CAPTION);

    SetWindowRgn( hwnd, CreateRectRgn(0,0,1,1), 1 );
    SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |SWP_NOZORDER | SWP_FRAMECHANGED);
   
    /*  Show and update our window  */
    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);


    /*  Retrieve and process messages until we get WM_QUIT  */
    while ( GetMessage(&msg, NULL, 0, 0) ) {
        TranslateMessage(&msg);    /*  for certain keyboard messages  */
        DispatchMessage(&msg);     /*  send message to WndProc        */
    }

    /*  Exit with status specified in WM_QUIT message  */
    return msg.wParam;
}


/*  Window procedure  */
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) {
    PAINTSTRUCT ps;
    HDC         hdc;
    RECT        rect;
   
    /*  Switch according to what type of message we have received  */
    switch ( iMsg ) {

    case WM_DESTROY:

        /*  Window has been destroyed, so exit cleanly  */
        PostQuitMessage(0);
        return 0;
    }


    /*  Send any messages we don't handle to default window procedure  */
    return DefWindowProc(hwnd, iMsg, wParam, lParam);
}

kv11111
 
Posts: 5
Joined: 14. Sep 2007, 19:57

Re: 1.5.0 Seamless and Compiz

Postby Joergle » 15. Sep 2007, 13:19

MNICY wrote:However, when i try to run it with Compiz, it does not work very well :(
The desktop kind of starts to lag (for lack of a better word) and the windows (in Windows) are buggy.
Is there a fix for this, because i like using compiz, but i also like this seamless better then using rdesktop...
thanks in advance for any replys :)


What helped for me is to use one of the tricks that were mentioned related to the VRDP (remote desktop) mode:

In the Windows Registry set the key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDesktop

to a value of '1'

This prevents Windows from drawing the Desktop. Please don't forget to do a (Windows) re-boot after the change.

Worked for me (openSuSE 10.2 Host, WinXP Guest, and using Beryl 3D). The refresh still takes some time though, but then ....

EDIT: Well, seems not to be 100% ok ... it works better, but not perfect :-(
Joergle
 
Posts: 14
Joined: 19. Jul 2007, 22:37

Postby captainc » 29. Nov 2007, 15:50

thats actually what i meant. The background messes up if i minimize everything.


Same thing here with Ubuntu Gutsy 32 bit. VM set to 32 megs video. Seamless works great besides this weird bug.
captainc
 
Posts: 7
Joined: 15. Nov 2007, 22:57

Seamless - Compiz

Postby Buzzsaw » 12. Dec 2007, 21:46

Hi,

I'm running XP with Virtualbox using Gutsy as the main operating System. I have Compiz cube on and I would like to know if anyone has their seamless XP so they can drag windows applications onto more than one cube face? I can't seem to do this.

Any help would be appreciated. Maybe it isn't possible? I also tried two monitors and it doesn't seem to be able to go between the monitors, one only.

Thanks,

Buzz
Buzzsaw
 
Posts: 1
Joined: 12. Dec 2007, 21:42

Postby dhartman » 4. Jan 2008, 21:02

I ran into the same problem where if one windows app wasn't opened, the whole screen would look very funky (like a wrong refresh rate on a monitor).

I added xeyes to the startup folder. But any small app would work.
dhartman
 
Posts: 1
Joined: 4. Jan 2008, 20:56

Postby paulus » 11. Jan 2008, 00:08

I have crosscompiled the kv11111's version of the program with
the first SetWindowLong line uncommented and the problem has
vanished totally :)

Thanks a lot! :)

P.S. For best experience use strip cfix.exe and put it in windows
registry for automatic startup (HKLM\Software\Microsoft\Windows\Run).
paulus
 
Posts: 1
Joined: 11. Jan 2008, 00:02

Postby JohanV » 5. Feb 2008, 11:54

meh, so how does a compiling noob actually compile kv11111's program? =(

Dont have mingw and gcc has some problems with windows.h?
JohanV
 
Posts: 6
Joined: 31. Jan 2008, 16:20

Postby stefan.becker » 5. Feb 2008, 22:09

Send me a PM with your E-Mail, i will send you "cfix.exe".
stefan.becker
Volunteer
 
Posts: 7543
Joined: 7. Jun 2007, 21:53

Re: 1.5.0 Seamless and Compiz

Postby vahnx » 17. Feb 2008, 20:42

Joergle wrote:In the Windows Registry set the key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDesktop

to a value of '1'

This prevents Windows from drawing the Desktop. Please don't forget to do a (Windows) re-boot after the change.


Do not waste your time with a reboot. With 99% of the registry changes (if not 100%) can easily be applied by launching the task manager and restarting the explorer.exe processes. A reboot is a big, really big waste of time.
vahnx
 
Posts: 13
Joined: 17. Feb 2008, 20:40

Postby tabination » 7. Mar 2008, 02:57

I confirm this worked with 1.5.4 OSE on Ubuntu 8.04.

Here is the complied cfix.exe
tabination
 
Posts: 2
Joined: 7. Mar 2008, 02:30

Postby watagan » 7. Mar 2008, 07:46

Does anyone have cfix working on 1.5.6? Works fine here on 1.5.4 but not on the later version.
watagan
 
Posts: 14
Joined: 30. Oct 2007, 09:17

Postby tabination » 7. Mar 2008, 20:50

I can confirm it works on vbox 1.5.6 and Ubuntu 7.10 with compiz. This specifically seems to fix the desktop redraw in seamless mode. I juse added cfix.exe to the all users startup folder.

Update 04/25/2008
Found problems with virtualbox OSE and Ubuntu 8.04. The seamless issue was back... I made some changes to cfix that seem to have solved the issue. I can confirm this now work in Ubuntu 8.04 running compiz and seamless mode in vbox 1.5.6 OSE. Here is the link for the compiled binary. Download cfix2.exe
tabination
 
Posts: 2
Joined: 7. Mar 2008, 02:30

Previous

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 10 guests