Commit 87bf99dc authored by Tor Lillqvist's avatar Tor Lillqvist

Fix Win32 build

parent 8d36170b
......@@ -308,7 +308,6 @@ static ATOM
RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
{
static ATOM klassTOPLEVEL = 0;
static ATOM klassDIALOG = 0;
static ATOM klassCHILD = 0;
static ATOM klassTEMP = 0;
static ATOM klassTEMPSHADOW = 0;
......@@ -482,7 +481,7 @@ _gdk_window_impl_new (GdkWindow *window,
(attributes->window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
(attributes->window_type == GDK_WINDOW_CHILD ? "CHILD" :
(attributes->window_type == GDK_WINDOW_TEMP ? "TEMP" :
"???"))))));
"???")))));
hparent = GDK_WINDOW_HWND (real_parent);
......
......@@ -389,8 +389,6 @@ gtk_size_request_mode_get_type G_GNUC_CONST
gtk_sort_type_get_type G_GNUC_CONST
gtk_spin_type_get_type G_GNUC_CONST
gtk_state_type_get_type G_GNUC_CONST
gtk_submenu_direction_get_type G_GNUC_CONST
gtk_submenu_placement_get_type G_GNUC_CONST
gtk_target_flags_get_type G_GNUC_CONST
gtk_text_direction_get_type G_GNUC_CONST
gtk_text_buffer_target_info_get_type G_GNUC_CONST
......
......@@ -1727,7 +1727,7 @@ insert_text_callback (GtkFileChooserEntry *chooser_entry,
*position + (colon - new_text) != 1) ||
(new_text_length > 0 &&
*position <= 1 &&
GTK_ENTRY (chooser_entry)->text_length >= 2 &&
gtk_entry_get_text_length (GTK_ENTRY (chooser_entry)) >= 2 &&
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':'))
{
gtk_widget_error_bell (GTK_WIDGET (chooser_entry));
......@@ -1746,7 +1746,7 @@ delete_text_callback (GtkFileChooserEntry *chooser_entry,
{
/* If deleting a drive letter, delete the colon, too */
if (start_pos == 0 && end_pos == 1 &&
GTK_ENTRY (chooser_entry)->text_length >= 2 &&
gtk_entry_get_text_length (GTK_ENTRY (chooser_entry)) >= 2 &&
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':')
{
g_signal_handlers_block_by_func (chooser_entry,
......
......@@ -50,13 +50,15 @@ _gtk_plug_windowing_get_id (GtkPlug *plug)
void
_gtk_plug_windowing_realize_toplevel (GtkPlug *plug)
{
if (plug->socket_window)
GtkPlugPrivate *priv = plug->priv;
if (priv->socket_window)
{
_gtk_win32_embed_send (plug->socket_window,
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_PARENT_NOTIFY,
(WPARAM) GDK_WINDOW_HWND (GTK_WIDGET (plug)->window),
GTK_WIN32_EMBED_PROTOCOL_VERSION);
_gtk_win32_embed_send (plug->socket_window,
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_EVENT_PLUG_MAPPED, 0, 0);
}
}
......@@ -64,8 +66,10 @@ _gtk_plug_windowing_realize_toplevel (GtkPlug *plug)
void
_gtk_plug_windowing_map_toplevel (GtkPlug *plug)
{
if (plug->socket_window)
_gtk_win32_embed_send (plug->socket_window,
GtkPlugPrivate *priv = plug->priv;
if (priv->socket_window)
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_EVENT_PLUG_MAPPED,
1, 0);
}
......@@ -73,8 +77,10 @@ _gtk_plug_windowing_map_toplevel (GtkPlug *plug)
void
_gtk_plug_windowing_unmap_toplevel (GtkPlug *plug)
{
if (plug->socket_window)
_gtk_win32_embed_send (plug->socket_window,
GtkPlugPrivate *priv = plug->priv;
if (priv->socket_window)
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_EVENT_PLUG_MAPPED,
0, 0);
}
......@@ -82,8 +88,10 @@ _gtk_plug_windowing_unmap_toplevel (GtkPlug *plug)
void
_gtk_plug_windowing_set_focus (GtkPlug *plug)
{
if (plug->socket_window)
_gtk_win32_embed_send (plug->socket_window,
GtkPlugPrivate *priv = plug->priv;
if (priv->socket_window)
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_REQUEST_FOCUS,
0, 0);
}
......@@ -93,8 +101,10 @@ _gtk_plug_windowing_add_grabbed_key (GtkPlug *plug,
guint accelerator_key,
GdkModifierType accelerator_mods)
{
if (plug->socket_window)
_gtk_win32_embed_send (plug->socket_window,
GtkPlugPrivate *priv = plug->priv;
if (priv->socket_window)
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_GRAB_KEY,
accelerator_key, accelerator_mods);
}
......@@ -104,8 +114,10 @@ _gtk_plug_windowing_remove_grabbed_key (GtkPlug *plug,
guint accelerator_key,
GdkModifierType accelerator_mods)
{
if (plug->socket_window)
_gtk_win32_embed_send (plug->socket_window,
GtkPlugPrivate *priv = plug->priv;
if (priv->socket_window)
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_UNGRAB_KEY,
accelerator_key, accelerator_mods);
}
......@@ -114,6 +126,7 @@ void
_gtk_plug_windowing_focus_to_parent (GtkPlug *plug,
GtkDirectionType direction)
{
GtkPlugPrivate *priv = plug->priv;
GtkWin32EmbedMessageType message = GTK_WIN32_EMBED_FOCUS_PREV;
switch (direction)
......@@ -130,7 +143,7 @@ _gtk_plug_windowing_focus_to_parent (GtkPlug *plug,
break;
}
_gtk_win32_embed_send_focus_message (plug->socket_window, message, 0);
_gtk_win32_embed_send_focus_message (priv->socket_window, message, 0);
}
GdkFilterReturn
......@@ -139,6 +152,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
gpointer data)
{
GtkPlug *plug = GTK_PLUG (data);
GtkPlugPrivate *priv = plug->priv;
MSG *msg = (MSG *) gdk_xevent;
GdkFilterReturn return_val = GDK_FILTER_CONTINUE;
......@@ -151,26 +165,26 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
* crashes in testsocket.
*/
case WM_WINDOWPOSCHANGED:
if (!plug->same_app)
if (!priv->same_app)
{
HWND parent = GetAncestor (msg->hwnd, GA_PARENT);
gboolean was_embedded = plug->socket_window != NULL;
gboolean was_embedded = priv->socket_window != NULL;
GdkScreen *screen = gdk_drawable_get_screen (event->any.window);
GdkDisplay *display = gdk_screen_get_display (screen);
GTK_NOTE (PLUGSOCKET, g_printerr ("WM_WINDOWPOSCHANGED: hwnd=%p GA_PARENT=%p socket_window=%p\n", msg->hwnd, parent, plug->socket_window));
GTK_NOTE (PLUGSOCKET, g_printerr ("WM_WINDOWPOSCHANGED: hwnd=%p GA_PARENT=%p socket_window=%p\n", msg->hwnd, parent, priv->socket_window));
g_object_ref (plug);
if (was_embedded)
{
/* End of embedding protocol for previous socket */
if (parent != GDK_WINDOW_HWND (plug->socket_window))
if (parent != GDK_WINDOW_HWND (priv->socket_window))
{
GtkWidget *widget = GTK_WIDGET (plug);
GTK_NOTE (PLUGSOCKET, g_printerr ("was_embedded, current parent != socket_window\n"));
gdk_window_set_user_data (plug->socket_window, NULL);
g_object_unref (plug->socket_window);
plug->socket_window = NULL;
gdk_window_set_user_data (priv->socket_window, NULL);
g_object_unref (priv->socket_window);
priv->socket_window = NULL;
/* Emit a delete window, as if the user attempted to
* close the toplevel. Only do this if we are being
......@@ -196,27 +210,27 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
/* Start of embedding protocol */
GTK_NOTE (PLUGSOCKET, g_printerr ("start of embedding\n"));
plug->socket_window = gdk_window_lookup_for_display (display, (GdkNativeWindow) parent);
if (plug->socket_window)
priv->socket_window = gdk_window_lookup_for_display (display, (GdkNativeWindow) parent);
if (priv->socket_window)
{
gpointer user_data = NULL;
GTK_NOTE (PLUGSOCKET, g_printerr ("already had socket_window\n"));
gdk_window_get_user_data (plug->socket_window, &user_data);
gdk_window_get_user_data (priv->socket_window, &user_data);
if (user_data)
{
g_warning (G_STRLOC "Plug reparented unexpectedly into window in the same process");
plug->socket_window = NULL;
priv->socket_window = NULL;
break;
}
g_object_ref (plug->socket_window);
g_object_ref (priv->socket_window);
}
else
{
plug->socket_window = gdk_window_foreign_new_for_display (display, (GdkNativeWindow) parent);
if (!plug->socket_window) /* Already gone */
priv->socket_window = gdk_window_foreign_new_for_display (display, (GdkNativeWindow) parent);
if (!priv->socket_window) /* Already gone */
break;
}
......@@ -231,9 +245,9 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
break;
case WM_SIZE:
if (!plug->same_app && plug->socket_window)
if (!priv->same_app && priv->socket_window)
{
_gtk_win32_embed_send (plug->socket_window,
_gtk_win32_embed_send (priv->socket_window,
GTK_WIN32_EMBED_PLUG_RESIZED,
0, 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment