Full-screen dragging fix (GC setting)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-03-01 18:09:39 +00:00
parent 831243b127
commit 66eca538a0
5 changed files with 22 additions and 10 deletions

View 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, 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. 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. Please see {\tt samples/dragimag} for an example.
\wxheading{Derived from} \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 by cutting down on the area under consideration, and it can also make a visual difference
since the drag is clipped to this area.} 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} \membersection{wxDragImage::EndDrag}\label{wxdragimageenddrag}
\func{bool}{EndDrag}{\void} \func{bool}{EndDrag}{\void}

View File

@@ -153,6 +153,10 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
{ {
wxGCPool[i].m_gc = gdk_gc_new( window ); wxGCPool[i].m_gc = gdk_gc_new( window );
gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE ); 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_type = type;
wxGCPool[i].m_used = FALSE; wxGCPool[i].m_used = FALSE;
} }

View File

@@ -153,6 +153,10 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
{ {
wxGCPool[i].m_gc = gdk_gc_new( window ); wxGCPool[i].m_gc = gdk_gc_new( window );
gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE ); 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_type = type;
wxGCPool[i].m_used = FALSE; wxGCPool[i].m_used = FALSE;
} }

View File

@@ -179,16 +179,17 @@ wxWindowDC::wxWindowDC( wxWindow *window )
gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display));
gcvalues.graphics_exposures = False; gcvalues.graphics_exposures = False;
gcvalues.subwindow_mode = IncludeInferiors;
gcvalues.line_width = 1; gcvalues.line_width = 1;
m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)),
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues); &gcvalues);
if (m_window->GetBackingPixmap()) if (m_window->GetBackingPixmap())
{ {
m_gcBacking = (WXGC) XCreateGC (display, RootWindow (display, m_gcBacking = (WXGC) XCreateGC (display, RootWindow (display,
DefaultScreen (display)), DefaultScreen (display)),
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues); &gcvalues);
} }

View File

@@ -44,9 +44,10 @@ wxMemoryDC::wxMemoryDC(void)
gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display));
gcvalues.graphics_exposures = False; gcvalues.graphics_exposures = False;
gcvalues.subwindow_mode = IncludeInferiors;
gcvalues.line_width = 1; gcvalues.line_width = 1;
m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)),
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues); &gcvalues);
m_backgroundPixel = (int) gcvalues.background; m_backgroundPixel = (int) gcvalues.background;
@@ -74,9 +75,10 @@ wxMemoryDC::wxMemoryDC( wxDC* dc )
gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display));
gcvalues.graphics_exposures = False; gcvalues.graphics_exposures = False;
gcvalues.subwindow_mode = IncludeInferiors;
gcvalues.line_width = 1; gcvalues.line_width = 1;
m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)),
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues); &gcvalues);
m_backgroundPixel = (int) gcvalues.background; m_backgroundPixel = (int) gcvalues.background;
@@ -110,9 +112,10 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display));
gcvalues.graphics_exposures = False; gcvalues.graphics_exposures = False;
gcvalues.subwindow_mode = IncludeInferiors;
gcvalues.line_width = 1; gcvalues.line_width = 1;
m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)),
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues); &gcvalues);
m_backgroundPixel = (int) gcvalues.background; m_backgroundPixel = (int) gcvalues.background;