From: Julian Smart Date: Wed, 1 Mar 2000 18:09:39 +0000 (+0000) Subject: Full-screen dragging fix (GC setting) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/66eca538a0f90a360998f25702412253224c52a0 Full-screen dragging fix (GC setting) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/dragimag.tex b/docs/latex/wx/dragimag.tex index 3f36e0c06e..be414f9123 100644 --- a/docs/latex/wx/dragimag.tex +++ b/docs/latex/wx/dragimag.tex @@ -14,6 +14,11 @@ initially call Show and then Move. If you wish to update the screen contents during the drag (for example, highlight an item as in the dragimag sample), first call Hide, update the screen, call Move, and then call Show. +You can drag within one window, or you can use full-screen dragging +either across the whole screen, or just restricted to one area +of the screen to save resources. If you want the user to drag between +two windows, then you will need to use full-screen dragging. + Please see {\tt samples/dragimag} for an example. \wxheading{Derived from} @@ -112,11 +117,6 @@ bounds the dragging operation. Specifying this can make the operation more effic by cutting down on the area under consideration, and it can also make a visual difference since the drag is clipped to this area.} -{\bf Please note:} full screen dragging only works on Windows at present, -because on Motif and GTK, the wxScreenDC used to implement full screen dragging only looks at the X root window and not -the windows on top, when copying from the screen to the backing bitmap. -Suggestions for solving this one are welcome! - \membersection{wxDragImage::EndDrag}\label{wxdragimageenddrag} \func{bool}{EndDrag}{\void} diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 84ad260e39..15b1c16e4b 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -153,6 +153,10 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type ) { wxGCPool[i].m_gc = gdk_gc_new( window ); gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE ); + // This allows you to e.g. copy from the screen + // without clipping the windows on it. + gdk_gc_set_subwindow( wxGCPool[i].m_gc, + GDK_INCLUDE_INFERIORS ); wxGCPool[i].m_type = type; wxGCPool[i].m_used = FALSE; } diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 84ad260e39..15b1c16e4b 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -153,6 +153,10 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type ) { wxGCPool[i].m_gc = gdk_gc_new( window ); gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE ); + // This allows you to e.g. copy from the screen + // without clipping the windows on it. + gdk_gc_set_subwindow( wxGCPool[i].m_gc, + GDK_INCLUDE_INFERIORS ); wxGCPool[i].m_type = type; wxGCPool[i].m_used = FALSE; } diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 8c42391326..ba5e1cdf3c 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -179,16 +179,17 @@ wxWindowDC::wxWindowDC( wxWindow *window ) gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.graphics_exposures = False; + gcvalues.subwindow_mode = IncludeInferiors; gcvalues.line_width = 1; m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), - GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, + GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode, &gcvalues); if (m_window->GetBackingPixmap()) { m_gcBacking = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), - GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, + GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode, &gcvalues); } diff --git a/src/motif/dcmemory.cpp b/src/motif/dcmemory.cpp index dea9a435cc..46f6d29183 100644 --- a/src/motif/dcmemory.cpp +++ b/src/motif/dcmemory.cpp @@ -44,9 +44,10 @@ wxMemoryDC::wxMemoryDC(void) gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.graphics_exposures = False; + gcvalues.subwindow_mode = IncludeInferiors; gcvalues.line_width = 1; m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), - GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, + GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode, &gcvalues); m_backgroundPixel = (int) gcvalues.background; @@ -74,9 +75,10 @@ wxMemoryDC::wxMemoryDC( wxDC* dc ) gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.graphics_exposures = False; + gcvalues.subwindow_mode = IncludeInferiors; gcvalues.line_width = 1; m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), - GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, + GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode, &gcvalues); m_backgroundPixel = (int) gcvalues.background; @@ -110,9 +112,10 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.graphics_exposures = False; + gcvalues.subwindow_mode = IncludeInferiors; gcvalues.line_width = 1; m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), - GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, + GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode, &gcvalues); m_backgroundPixel = (int) gcvalues.background;