summaryrefslogtreecommitdiff
path: root/gdk/win32
diff options
context:
space:
mode:
authorHans Breuer <hans@breuer.org>2004-02-28 13:21:25 +0000
committerHans Breuer <hans@src.gnome.org>2004-02-28 13:21:25 +0000
commit75aa148d971903f1e5f8da417f8ae0091cded11c (patch)
treed72782e3cd177dbf9682aaf558b518c8f68ceb40 /gdk/win32
parentc93d98ee5f61c68a5fc7e25fd88f4a8c436bb85b (diff)
downloadgdk-pixbuf-75aa148d971903f1e5f8da417f8ae0091cded11c.tar.gz
set current_dest_drag to NULL when destroying, fixes bug #120007. Also
2004-02-28 Hans Breuer <hans@breuer.org> * gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL when destroying, fixes bug #120007. Also removed the mirrored ref counting for deprecated gdk_drag_context_<ref|unref>() cause it wasn't reliable anymore anyway. * gdk/win32/gdkdisplay-win32.c : fix typo, which should have broken the win32 build for everyone not using msvc * gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to return negative values for ptMaxTrackSize, it caused snapping windows to their minimum size
Diffstat (limited to 'gdk/win32')
-rw-r--r--gdk/win32/gdkdisplay-win32.c2
-rw-r--r--gdk/win32/gdkdnd-win32.c18
-rw-r--r--gdk/win32/gdkevents-win32.c9
3 files changed, 18 insertions, 11 deletions
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 4ae4e5374..36cd1fc0c 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -43,7 +43,7 @@ _gdk_windowing_set_default_display (GdkDisplay *display)
g_assert (_gdk_display == display);
}
-#ifdef HVAE_MONITOR_INFO
+#ifdef HAVE_MONITOR_INFO
static BOOL CALLBACK
count_monitor (HMONITOR hmonitor,
HDC hdc,
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index 39be3b993..2cee5ba70 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -87,8 +87,6 @@ static int nformats;
* this is used on both source and destination sides.
*/
struct _GdkDragContextPrivateWin32 {
- gint ref_count;
-
guint16 last_x; /* Coordinates from last event */
guint16 last_y;
HWND dest_xid;
@@ -140,7 +138,6 @@ gdk_drag_context_init (GdkDragContext *dragcontext)
GdkDragContextPrivateWin32 *private = g_new0 (GdkDragContextPrivateWin32, 1);
dragcontext->windowing_data = private;
- private->ref_count = 1;
contexts = g_list_prepend (contexts, dragcontext);
}
@@ -160,7 +157,9 @@ gdk_drag_context_finalize (GObject *object)
{
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
GdkDragContextPrivateWin32 *private = GDK_DRAG_CONTEXT_PRIVATE_DATA (context);
-
+
+ GDK_NOTE (DND, g_print ("gdk_drag_context_finalize\n"));
+
g_list_free (context->targets);
if (context->source_window)
@@ -173,6 +172,9 @@ gdk_drag_context_finalize (GObject *object)
contexts = g_list_remove (contexts, context);
+ if (context == current_dest_drag)
+ current_dest_drag = NULL;
+
g_free (private);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -191,8 +193,6 @@ gdk_drag_context_ref (GdkDragContext *context)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- GDK_NOTE (DND, g_print ("gdk_drag_context_ref: %p %d\n", context, G_OBJECT(context)->ref_count));
-
g_object_ref (context);
}
@@ -201,7 +201,6 @@ gdk_drag_context_unref (GdkDragContext *context)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- GDK_NOTE (DND, g_print ("gdk_drag_context_unref: %p %d\n", context, G_OBJECT(context)->ref_count));
g_object_unref (context);
}
@@ -1171,6 +1170,7 @@ local_send_drop (GdkDragContext *context,
GdkDragContextPrivateWin32 *private;
private = GDK_DRAG_CONTEXT_PRIVATE_DATA (current_dest_drag);
+ /* Pass ownership of context to the event */
tmp_event.dnd.type = GDK_DROP_START;
tmp_event.dnd.window = current_dest_drag->dest_window;
tmp_event.dnd.send_event = FALSE;
@@ -1180,6 +1180,8 @@ local_send_drop (GdkDragContext *context,
tmp_event.dnd.x_root = private->last_x;
tmp_event.dnd.y_root = private->last_y;
+ current_dest_drag = NULL;
+
gdk_event_put (&tmp_event);
}
@@ -1607,7 +1609,7 @@ gdk_drop_finish (GdkDragContext *context,
g_return_if_fail (context != NULL);
- GDK_NOTE (DND, g_print ("gdk_drop_finish\n"));
+ GDK_NOTE (DND, g_print ("gdk_drop_finish"));
private = GDK_DRAG_CONTEXT_PRIVATE_DATA (context);
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 89e854896..0a6827db8 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -3177,14 +3177,19 @@ gdk_event_translate (GdkDisplay *display,
if (impl->hint_flags & GDK_HINT_MAX_SIZE)
{
+ int maxw, maxh;
+
rect.left = rect.top = 0;
rect.right = impl->hints.max_width;
rect.bottom = impl->hints.max_height;
_gdk_win32_adjust_client_rect (window, &rect);
- mmi->ptMaxTrackSize.x = rect.right - rect.left;
- mmi->ptMaxTrackSize.y = rect.bottom - rect.top;
+ /* at least on win9x we have the 16 bit trouble */
+ maxw = rect.right - rect.left;
+ maxh = rect.bottom - rect.top;
+ mmi->ptMaxTrackSize.x = maxw > 0 && maxw < G_MAXSHORT ? maxw : G_MAXSHORT;
+ mmi->ptMaxTrackSize.y = maxh > 0 && maxh < G_MAXSHORT ? maxw : G_MAXSHORT;
}
if (impl->hint_flags & (GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE))