Page 2 of 2

Posted: 15. Sep 2007, 09:07
by kv11111
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

#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);
}


Re: 1.5.0 Seamless and Compiz

Posted: 15. Sep 2007, 13:19
by Joergle
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 :-(

Posted: 29. Nov 2007, 15:50
by captainc
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.

Seamless - Compiz

Posted: 12. Dec 2007, 21:46
by Buzzsaw
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

Posted: 4. Jan 2008, 21:02
by dhartman
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.

Posted: 11. Jan 2008, 00:08
by paulus
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).

Posted: 5. Feb 2008, 11:54
by JohanV
meh, so how does a compiling noob actually compile kv11111's program? =(

Dont have mingw and gcc has some problems with windows.h?

Posted: 5. Feb 2008, 22:09
by stefan.becker
Send me a PM with your E-Mail, i will send you "cfix.exe".

Re: 1.5.0 Seamless and Compiz

Posted: 17. Feb 2008, 20:42
by vahnx
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.

Posted: 7. Mar 2008, 02:57
by tabination
I confirm this worked with 1.5.4 OSE on Ubuntu 8.04.

Here is the complied cfix.exe

Posted: 7. Mar 2008, 07:46
by watagan
Does anyone have cfix working on 1.5.6? Works fine here on 1.5.4 but not on the later version.

Posted: 7. Mar 2008, 20:50
by tabination
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