]> git.saurik.com Git - wxWidgets.git/commitdiff
Full-screen dragging fix (GC setting)
authorJulian Smart <julian@anthemion.co.uk>
Wed, 1 Mar 2000 18:09:39 +0000 (18:09 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 1 Mar 2000 18:09:39 +0000 (18:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/dragimag.tex
src/gtk/dcclient.cpp
src/gtk1/dcclient.cpp
src/motif/dcclient.cpp
src/motif/dcmemory.cpp

index 3f36e0c06e892631b4335dfe5f0a087e6ca45478..be414f912328569d3ac1dff23685c9ad45cdf64a 100644 (file)
@@ -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}
index 84ad260e394188ffd668d290a7d9eb2e72ca2c2e..15b1c16e4b0cd3b15c90f80546fbb21043d6e13b 100644 (file)
@@ -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;
         }
index 84ad260e394188ffd668d290a7d9eb2e72ca2c2e..15b1c16e4b0cd3b15c90f80546fbb21043d6e13b 100644 (file)
@@ -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;
         }
index 8c423913263f28246b286b0e065fa3e1cb3a3c34..ba5e1cdf3c41ca975b94c157517f70d450c0d1e9 100644 (file)
@@ -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);
     }
 
index dea9a435ccbd91f9bb606f6f5d97bfe5ddd96dbc..46f6d29183c6a1d733289ecce136ad9433afbc74 100644 (file)
@@ -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;