Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dorota Czaplejewicz
gtk
Commits
120df3b8
Commit
120df3b8
authored
Mar 10, 1998
by
Elliot Lee
Browse files
DnD bugfixes (hopefully :). Rasters code is still buggy, methinks - try the dnd in testgtk
parent
fabfc17d
Changes
7
Hide whitespace changes
Inline
Side-by-side
gdk/gdk.c
View file @
120df3b8
...
...
@@ -2069,7 +2069,10 @@ gdk_event_translate (GdkEvent *event,
/* XXX there has to be a better way to do this, perhaps with
XTranslateCoordinates or XQueryTree - I don't know how,
and this sort of works */
static
Window
lastwin
=
None
,
curwin
=
None
,
twin
;
static
Window
lastwin
=
None
,
curwin
=
None
;
#if 0
Window twin;
#endif
Window
childwin
=
gdk_root_window
;
int
x
,
y
,
ox
,
oy
;
...
...
@@ -2083,6 +2086,13 @@ gdk_event_translate (GdkEvent *event,
curwin
=
gdk_root_window
;
ox
=
x
=
xevent
->
xmotion
.
x_root
;
oy
=
y
=
xevent
->
xmotion
.
y_root
;
#if 1
curwin
=
gdk_window_xid_at_coords
(
xevent
->
xmotion
.
x_root
,
xevent
->
xmotion
.
y_root
,
gdk_dnd
.
c
->
xids
);
XTranslateCoordinates
(
gdk_display
,
gdk_root_window
,
curwin
,
x
,
y
,
&
x
,
&
y
,
&
childwin
);
#else
while
(
childwin
!=
None
)
{
ox
=
x
;
oy
=
y
;
...
...
@@ -2095,6 +2105,7 @@ gdk_event_translate (GdkEvent *event,
x
,
y
,
&
x
,
&
y
,
&
twin
);
}
}
#endif
GDK_NOTE
(
DND
,
g_print
(
"Drag is now in window %#lx, lastwin was %#lx, ddc = %#lx
\n
"
,
curwin
,
lastwin
,
gdk_dnd
.
dnd_drag_curwin
));
...
...
gdk/gdkdnd.c
View file @
120df3b8
...
...
@@ -26,6 +26,8 @@ gdk_dnd_set_drag_cursors(GdkCursor *default_cursor, GdkCursor *goahead_cursor)
gdk_window_unref
(
gdk_dnd
.
c
->
drag_pm_ok
);
}
gdk_dnd
.
c
->
drag_pm_default
=
gdk_dnd
.
c
->
drag_pm_ok
=
NULL
;
g_list_free
(
gdk_dnd
.
c
->
xids
);
gdk_dnd
.
c
->
xids
=
NULL
;
}
gdk_dnd_display_drag_cursor
(
-
1
,
-
1
,
gdk_dnd
.
dnd_drag_target
?
TRUE
:
FALSE
,
...
...
@@ -41,6 +43,7 @@ gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
{
g_return_if_fail
(
default_pixmapwin
!=
NULL
);
g_list_free
(
gdk_dnd
.
c
->
xids
);
gdk_dnd
.
c
->
xids
=
NULL
;
if
(
gdk_dnd
.
c
->
drag_pm_default
)
gdk_window_unref
(
gdk_dnd
.
c
->
drag_pm_default
);
if
(
gdk_dnd
.
c
->
drag_pm_ok
)
...
...
@@ -51,9 +54,11 @@ gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
gdk_window_ref
(
default_pixmapwin
);
gdk_dnd
.
c
->
drag_pm_default
=
default_pixmapwin
;
gdk_dnd
.
c
->
default_hotspot
=
*
default_hotspot
;
gdk_dnd
.
c
->
xids
=
g_list_append
(
gdk_dnd
.
c
->
xids
,
((
GdkWindowPrivate
*
)
default_pixmapwin
)
->
xwindow
);
if
(
goahead_pixmapwin
)
{
gdk_window_ref
(
goahead_pixmapwin
);
gdk_dnd
.
c
->
xids
=
g_list_append
(
gdk_dnd
.
c
->
xids
,
((
GdkWindowPrivate
*
)
goahead_pixmapwin
)
->
xwindow
);
gdk_dnd
.
c
->
drag_pm_ok
=
goahead_pixmapwin
;
gdk_dnd
.
c
->
ok_hotspot
=
*
goahead_hotspot
;
}
...
...
gdk/gdkglobals.c
View file @
120df3b8
...
...
@@ -34,7 +34,7 @@ Atom gdk_wm_protocols;
Atom
gdk_wm_window_protocols
[
2
];
Atom
gdk_selection_property
;
GdkDndCursorInfo
gdk_dnd_cursorinfo
=
{
None
,
None
,
NULL
,
NULL
,
{
0
,
0
},
{
0
,
0
}};
{
0
,
0
},
{
0
,
0
}
,
NULL
};
GdkDndGlobals
gdk_dnd
=
{
None
,
None
,
None
,
None
,
None
,
None
,
None
,
...
...
gdk/gdkprivate.h
View file @
120df3b8
...
...
@@ -146,6 +146,7 @@ struct _GdkDndCursorInfo {
Cursor
gdk_cursor_dragdefault
,
gdk_cursor_dragok
;
GdkWindow
*
drag_pm_default
,
*
drag_pm_ok
;
GdkPoint
default_hotspot
,
ok_hotspot
;
GList
*
xids
;
};
typedef
struct
_GdkDndCursorInfo
GdkDndCursorInfo
;
...
...
gdk/x11/gdkdnd-x11.c
View file @
120df3b8
...
...
@@ -26,6 +26,8 @@ gdk_dnd_set_drag_cursors(GdkCursor *default_cursor, GdkCursor *goahead_cursor)
gdk_window_unref
(
gdk_dnd
.
c
->
drag_pm_ok
);
}
gdk_dnd
.
c
->
drag_pm_default
=
gdk_dnd
.
c
->
drag_pm_ok
=
NULL
;
g_list_free
(
gdk_dnd
.
c
->
xids
);
gdk_dnd
.
c
->
xids
=
NULL
;
}
gdk_dnd_display_drag_cursor
(
-
1
,
-
1
,
gdk_dnd
.
dnd_drag_target
?
TRUE
:
FALSE
,
...
...
@@ -41,6 +43,7 @@ gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
{
g_return_if_fail
(
default_pixmapwin
!=
NULL
);
g_list_free
(
gdk_dnd
.
c
->
xids
);
gdk_dnd
.
c
->
xids
=
NULL
;
if
(
gdk_dnd
.
c
->
drag_pm_default
)
gdk_window_unref
(
gdk_dnd
.
c
->
drag_pm_default
);
if
(
gdk_dnd
.
c
->
drag_pm_ok
)
...
...
@@ -51,9 +54,11 @@ gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
gdk_window_ref
(
default_pixmapwin
);
gdk_dnd
.
c
->
drag_pm_default
=
default_pixmapwin
;
gdk_dnd
.
c
->
default_hotspot
=
*
default_hotspot
;
gdk_dnd
.
c
->
xids
=
g_list_append
(
gdk_dnd
.
c
->
xids
,
((
GdkWindowPrivate
*
)
default_pixmapwin
)
->
xwindow
);
if
(
goahead_pixmapwin
)
{
gdk_window_ref
(
goahead_pixmapwin
);
gdk_dnd
.
c
->
xids
=
g_list_append
(
gdk_dnd
.
c
->
xids
,
((
GdkWindowPrivate
*
)
goahead_pixmapwin
)
->
xwindow
);
gdk_dnd
.
c
->
drag_pm_ok
=
goahead_pixmapwin
;
gdk_dnd
.
c
->
ok_hotspot
=
*
goahead_hotspot
;
}
...
...
gdk/x11/gdkglobals-x11.c
View file @
120df3b8
...
...
@@ -34,7 +34,7 @@ Atom gdk_wm_protocols;
Atom
gdk_wm_window_protocols
[
2
];
Atom
gdk_selection_property
;
GdkDndCursorInfo
gdk_dnd_cursorinfo
=
{
None
,
None
,
NULL
,
NULL
,
{
0
,
0
},
{
0
,
0
}};
{
0
,
0
},
{
0
,
0
}
,
NULL
};
GdkDndGlobals
gdk_dnd
=
{
None
,
None
,
None
,
None
,
None
,
None
,
None
,
...
...
gdk/x11/gdkmain-x11.c
View file @
120df3b8
...
...
@@ -2069,7 +2069,10 @@ gdk_event_translate (GdkEvent *event,
/* XXX there has to be a better way to do this, perhaps with
XTranslateCoordinates or XQueryTree - I don't know how,
and this sort of works */
static
Window
lastwin
=
None
,
curwin
=
None
,
twin
;
static
Window
lastwin
=
None
,
curwin
=
None
;
#if 0
Window twin;
#endif
Window
childwin
=
gdk_root_window
;
int
x
,
y
,
ox
,
oy
;
...
...
@@ -2083,6 +2086,13 @@ gdk_event_translate (GdkEvent *event,
curwin
=
gdk_root_window
;
ox
=
x
=
xevent
->
xmotion
.
x_root
;
oy
=
y
=
xevent
->
xmotion
.
y_root
;
#if 1
curwin
=
gdk_window_xid_at_coords
(
xevent
->
xmotion
.
x_root
,
xevent
->
xmotion
.
y_root
,
gdk_dnd
.
c
->
xids
);
XTranslateCoordinates
(
gdk_display
,
gdk_root_window
,
curwin
,
x
,
y
,
&
x
,
&
y
,
&
childwin
);
#else
while
(
childwin
!=
None
)
{
ox
=
x
;
oy
=
y
;
...
...
@@ -2095,6 +2105,7 @@ gdk_event_translate (GdkEvent *event,
x
,
y
,
&
x
,
&
y
,
&
twin
);
}
}
#endif
GDK_NOTE
(
DND
,
g_print
(
"Drag is now in window %#lx, lastwin was %#lx, ddc = %#lx
\n
"
,
curwin
,
lastwin
,
gdk_dnd
.
dnd_drag_curwin
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment