Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'
GTK4: various fixes See merge request GNOME/gtk!2864
This commit is contained in:
@@ -512,7 +512,7 @@ _gdk_macos_display_surface_became_key (GdkMacosDisplay *self,
|
||||
* ("is not key"). We send a dummy motion notify event now, so that
|
||||
* everything in the window is set to correct state.
|
||||
*/
|
||||
gdk_surface_request_motion (surface);
|
||||
gdk_surface_request_motion (GDK_SURFACE (surface));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -525,8 +525,8 @@ select_thread_start_poll (GPollFD *ufds,
|
||||
have_new_pollfds = TRUE;
|
||||
else
|
||||
{
|
||||
if (!((nfds == 1 && poll_fd_index < 0 && g_thread_supported ()) ||
|
||||
(nfds == 2 && poll_fd_index >= 0 && g_thread_supported ())))
|
||||
if (!((nfds == 1 && poll_fd_index < 0) ||
|
||||
(nfds == 2 && poll_fd_index >= 0)))
|
||||
select_thread_set_state (POLLING_RESTART);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,14 +150,14 @@ ensure_gl_view (GdkMacosGLContext *self)
|
||||
|
||||
if (self->dummy_view != NULL)
|
||||
{
|
||||
NSView *nsview = g_steal_pointer (&self->dummy_view);
|
||||
[nsview release];
|
||||
NSView *dummy_view = g_steal_pointer (&self->dummy_view);
|
||||
[dummy_view release];
|
||||
}
|
||||
|
||||
if (self->dummy_window != NULL)
|
||||
{
|
||||
NSWindow *nswindow = g_steal_pointer (&self->dummy_window);
|
||||
[nswindow release];
|
||||
NSWindow *dummy_window = g_steal_pointer (&self->dummy_window);
|
||||
[dummy_window release];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,6 @@ gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
|
||||
|
||||
if (self->dummy_view != NULL)
|
||||
{
|
||||
GdkSurface *surface = gdk_draw_context_get_surface (context);
|
||||
NSRect frame = NSMakeRect (0, 0, surface->width, surface->height);
|
||||
|
||||
[self->dummy_window setFrame:frame display:NO];
|
||||
@@ -327,18 +326,10 @@ gdk_macos_gl_context_end_frame (GdkDrawContext *context,
|
||||
cairo_region_t *painted)
|
||||
{
|
||||
GdkMacosGLContext *self = GDK_MACOS_GL_CONTEXT (context);
|
||||
GdkMacosSurface *surface;
|
||||
NSView *nsview;
|
||||
cairo_rectangle_int_t extents;
|
||||
|
||||
g_assert (GDK_IS_MACOS_GL_CONTEXT (self));
|
||||
g_assert (self->gl_context != nil);
|
||||
|
||||
surface = GDK_MACOS_SURFACE (gdk_draw_context_get_surface (context));
|
||||
nsview = self->dummy_view ?
|
||||
self->dummy_view :
|
||||
_gdk_macos_surface_get_view (surface);
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->end_frame (context, painted);
|
||||
|
||||
/* We want to limit how much gets moved to the front buffer so here
|
||||
|
||||
@@ -2793,8 +2793,12 @@ apply_modelview_op (const Program *program,
|
||||
{
|
||||
float mat[16];
|
||||
|
||||
OP_PRINT (" -> Modelview");
|
||||
graphene_matrix_to_float (&op->matrix, mat);
|
||||
OP_PRINT (" -> Modelview { { %f,%f,%f,%f }, { %f,%f,%f,%f }, { %f,%f,%f,%f }, { %f,%f,%f,%f }",
|
||||
mat[0], mat[1], mat[2], mat[3],
|
||||
mat[4], mat[5], mat[6], mat[7],
|
||||
mat[8], mat[9], mat[10], mat[11],
|
||||
mat[12], mat[13], mat[14], mat[15]);
|
||||
glUniformMatrix4fv (program->modelview_location, 1, GL_FALSE, mat);
|
||||
}
|
||||
|
||||
@@ -2804,8 +2808,12 @@ apply_projection_op (const Program *program,
|
||||
{
|
||||
float mat[16];
|
||||
|
||||
OP_PRINT (" -> Projection");
|
||||
graphene_matrix_to_float (&op->matrix, mat);
|
||||
OP_PRINT (" -> Projection { { %f,%f,%f,%f }, { %f,%f,%f,%f }, { %f,%f,%f,%f }, { %f,%f,%f,%f }",
|
||||
mat[0], mat[1], mat[2], mat[3],
|
||||
mat[4], mat[5], mat[6], mat[7],
|
||||
mat[8], mat[9], mat[10], mat[11],
|
||||
mat[12], mat[13], mat[14], mat[15]);
|
||||
glUniformMatrix4fv (program->projection_location, 1, GL_FALSE, mat);
|
||||
}
|
||||
|
||||
@@ -3260,6 +3268,7 @@ gsk_gl_renderer_create_programs (GskGLRenderer *self,
|
||||
{
|
||||
Program *prog = &programs->programs[i];
|
||||
|
||||
prog->name = program_definitions[i].name;
|
||||
prog->index = i;
|
||||
prog->id = gsk_gl_shader_builder_create_program (&shader_builder,
|
||||
program_definitions[i].resource_path,
|
||||
@@ -4052,8 +4061,9 @@ gsk_gl_renderer_render_ops (GskGLRenderer *self)
|
||||
{
|
||||
const OpDraw *op = ptr;
|
||||
|
||||
OP_PRINT (" -> draw %ld, size %ld and program %d\n",
|
||||
op->vao_offset, op->vao_size, program->index);
|
||||
OP_PRINT (" -> draw %ld, size %ld and program %d: %s",
|
||||
op->vao_offset, op->vao_size, program->index,
|
||||
program->name ?: "");
|
||||
glDrawArrays (GL_TRIANGLES, op->vao_offset, op->vao_size);
|
||||
break;
|
||||
}
|
||||
@@ -4273,7 +4283,7 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
|
||||
g_type_name_from_instance ((GTypeInstance *) root),
|
||||
root,
|
||||
fbo_id);
|
||||
glFramebufferTexture (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture_id, 0);
|
||||
glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0);
|
||||
|
||||
/* Render the actual scene */
|
||||
gsk_gl_renderer_do_render (renderer, root, viewport, fbo_id, 1);
|
||||
|
||||
@@ -90,6 +90,8 @@ typedef struct
|
||||
|
||||
struct _Program
|
||||
{
|
||||
const char *name;
|
||||
|
||||
int index; /* Into the renderer's program array -1 for custom */
|
||||
|
||||
int id;
|
||||
|
||||
@@ -185,7 +185,7 @@ gtk_application_impl_quartz_startup (GtkApplicationImpl *impl,
|
||||
if (register_session)
|
||||
{
|
||||
quartz->delegate = [[GtkApplicationQuartzDelegate alloc] initWithImpl:quartz];
|
||||
[NSApp setDelegate: quartz->delegate];
|
||||
[NSApp setDelegate: (id<NSApplicationDelegate>)quartz->delegate];
|
||||
}
|
||||
|
||||
quartz->muxer = gtk_action_muxer_new (NULL);
|
||||
@@ -216,7 +216,7 @@ gtk_application_impl_quartz_startup (GtkApplicationImpl *impl,
|
||||
* app menu at index 0 in 'combined'.
|
||||
*/
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/libgtk/ui/gtkapplication-quartz.ui");
|
||||
app_menu = G_MENU (gtk_builder_get_object (builder, "app-menu"));
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"));
|
||||
g_object_set_data_full (G_OBJECT (impl), "APP_DATA", g_object_ref (app_menu), g_object_unref);
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ filechooser_quartz_launch (FileChooserQuartzData *data)
|
||||
|
||||
void (^handler)(NSInteger ret) = ^(NSInteger result) {
|
||||
|
||||
if (result == NSFileHandlingPanelOKButton)
|
||||
if (result == NSModalResponseOK)
|
||||
{
|
||||
// get selected files and update data->files
|
||||
data->response = GTK_RESPONSE_ACCEPT;
|
||||
|
||||
@@ -405,7 +405,7 @@ lpr_printer_get_options (GtkPrinter *printer,
|
||||
|
||||
option = gtk_printer_option_new ("gtk-n-up", _("Pages Per Sheet"), GTK_PRINTER_OPTION_TYPE_PICKONE);
|
||||
gtk_printer_option_choices_from_array (option, G_N_ELEMENTS (n_up),
|
||||
n_up, n_up);
|
||||
(char **)n_up, (char **)n_up);
|
||||
gtk_printer_option_set (option, "1");
|
||||
gtk_printer_option_set_add (set, option);
|
||||
g_object_unref (option);
|
||||
|
||||
Reference in New Issue
Block a user