Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1.6k
    • Issues 1.6k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 296
    • Merge requests 296
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gtkgtk
  • Issues
  • #2439

Win32: transient window lowered when clicked on non-focused application

transienttest-screenshot-windows

Steps to reproduce

  1. Open two transient windows with the same parent and arrange them overlapping, window 2 on top
  2. Give focus to another application (e.g. Windows Explorer)
  3. Click transient window 2 (the one on top)

Current behavior

Transient window 2 gets lowered below transient window 1.

Expected outcome

Transient window 2 stays on top, since it receives the focus.

Version information

  • Windows 10
  • gtk 3.24.13

Example program

#include <gtk/gtk.h>

static void activate (GtkApplication* app, gpointer user_data)
{
  char transienttitle[] = "0 Transient Window";
  int transient_count = 2;
  GtkWidget *parentwindow;

  parentwindow = gtk_application_window_new (app);
  gtk_window_set_title (GTK_WINDOW (parentwindow), "Parent Window");
  gtk_window_set_default_size (GTK_WINDOW (parentwindow), 400, 200);

  while (transient_count-- > 0) {
    GtkWidget *transientwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    ++transienttitle[0];
    gtk_window_set_title (GTK_WINDOW (transientwindow), transienttitle);
    gtk_window_set_default_size (GTK_WINDOW (transientwindow), 300, 100);
    gtk_window_set_transient_for (GTK_WINDOW(transientwindow), GTK_WINDOW(parentwindow));
    gtk_widget_show_all (transientwindow);
  }

  gtk_widget_show_all (parentwindow);
}

int main (int argc, char **argv)
{
  GtkApplication *app;
  int status;

  app = gtk_application_new ("test.transient", G_APPLICATION_FLAGS_NONE);
  g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
  status = g_application_run (G_APPLICATION (app), argc, argv);
  g_object_unref (app);

  return status;
}
Edited Feb 17, 2020 by Thomas Holder
Assignee
Assign to
Time tracking