< prev index next >
modules/graphics/src/main/native-glass/gtk/GlassWindow.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 26,36 ****
#include <com_sun_glass_events_WindowEvent.h>
#include <com_sun_glass_events_ViewEvent.h>
#include <cstdlib>
#include <cstring>
- #include "glass_gtkcompat.h"
#include "glass_general.h"
#include "glass_evloop.h"
#include "glass_window.h"
#define JLONG_TO_WINDOW_CTX(ptr) ((WindowContext*)JLONG_TO_PTR(ptr))
--- 26,35 ----
*** 81,92 ****
JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_gtk_GtkWindow__1createWindow
(JNIEnv * env, jobject obj, jlong owner, jlong screen, jint mask)
{
(void)env;
WindowContext* ctx = new WindowContextTop(obj,
! (WindowContext*)JLONG_TO_PTR(owner),
screen,
glass_mask_to_window_frame_type(mask),
glass_mask_to_window_type(mask),
glass_mask_to_wm_function(mask)
);
--- 80,92 ----
JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_gtk_GtkWindow__1createWindow
(JNIEnv * env, jobject obj, jlong owner, jlong screen, jint mask)
{
(void)env;
+ WindowContext* parent = JLONG_TO_WINDOW_CTX(owner);
WindowContext* ctx = new WindowContextTop(obj,
! parent,
screen,
glass_mask_to_window_frame_type(mask),
glass_mask_to_window_type(mask),
glass_mask_to_wm_function(mask)
);
*** 107,119 ****
GdkWindow *parent_window = NULL;
GtkWidget *parent_widget = NULL;
WindowContextPlug *parent_ctx = NULL;
WindowContext *ctx = NULL;
! parent_window = GLASS_GDK_WINDOW_LOOKUP_FOR_DISPLAY(
gdk_display_get_default(),
! (GdkNativeWindow)PTR_TO_JLONG(owner));
if (parent_window != NULL) {
parent_ctx = (WindowContextPlug *)g_object_get_data(G_OBJECT(parent_window), GDK_WINDOW_DATA_CONTEXT);
// HACK: do not use get_gtk_window()
// the method is intended to return GtkWindow that can be used for FileChooser
--- 107,119 ----
GdkWindow *parent_window = NULL;
GtkWidget *parent_widget = NULL;
WindowContextPlug *parent_ctx = NULL;
WindowContext *ctx = NULL;
! parent_window = gdk_x11_window_lookup_for_display(
gdk_display_get_default(),
! (Window)PTR_TO_JLONG(owner));
if (parent_window != NULL) {
parent_ctx = (WindowContextPlug *)g_object_get_data(G_OBJECT(parent_window), GDK_WINDOW_DATA_CONTEXT);
// HACK: do not use get_gtk_window()
// the method is intended to return GtkWindow that can be used for FileChooser
< prev index next >