-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hawk Desktop Environment - Incorrect Window Management Paradigm
I am developing a New Desktop Environment from Scratch. I have tested the Desktop Environment on vnc Server, but my Desktop Environment said Incorrect Window Management Paradigm, And My Desktop Environment crashed on startup. I Want To Use GTK On All Opened X11 Windows Like Mutter Window Manager (Used On GNOME, xfce, cinnamon).
On hawkwm/window-manager.c: GTK Plug Variable Declared On Line 47
47: GtkWidget *plug = gtk_plug_new((Window)window); // GTK Plug Starts Here
48: if (!plug) return;
49:
50: GtkWidget *panel = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
51:
52: // Title label (centered)
53: GtkWidget *title_label = gtk_label_new(title ? title : "");
54: gtk_label_set_ellipsize(GTK_LABEL(title_label), PANGO_ELLIPSIZE_END);
55: // Controls container (right-aligned)
56: GtkWidget *controls = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);Errors On Start:
root@ceb678735428:/workspace/hawk-desktop# cat /root/.vnc/ceb678735428:3389.log
05/09/25 17:13:02 Xvnc version TightVNC-1.3.10
05/09/25 17:13:02 Copyright (C) 2000-2009 TightVNC Group
05/09/25 17:13:02 Copyright (C) 1999 AT&T Laboratories Cambridge
05/09/25 17:13:02 All Rights Reserved.
05/09/25 17:13:02 See http://www.tightvnc.com/ for information on TightVNC
05/09/25 17:13:02 Desktop name 'X' (ceb678735428:3389)
05/09/25 17:13:02 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
05/09/25 17:13:02 Listening for VNC connections on TCP port 9289
Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
(hawk-session:87988): Gdk-WARNING **: 17:13:03.822: ../../../gdk/gdkwindow.c:1444Toplevel windows must be created as children of
of a window of type GDK_WINDOW_ROOT or GDK_WINDOW_FOREIGN
(hawk-session:87988): GLib-GObject-CRITICAL **: 17:13:03.823: invalid (NULL) pointer instance
(hawk-session:87988): GLib-GObject-CRITICAL **: 17:13:03.823: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(hawk-session:87988): GLib-GObject-CRITICAL **: 17:13:03.824: invalid (NULL) pointer instance
(hawk-session:87988): GLib-GObject-CRITICAL **: 17:13:03.824: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(hawk-session:87988): Gdk-CRITICAL **: 17:13:03.824: _gdk_frame_clock_freeze: assertion 'GDK_IS_FRAME_CLOCK (clock)' failed
(hawk-session:87988): GLib-GObject-CRITICAL **: 17:13:03.829: invalid (NULL) pointer instance
(hawk-session:87988): GLib-GObject-CRITICAL **: 17:13:03.829: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(hawk-session:87988): Gdk-CRITICAL **: 17:13:03.829: gdk_frame_clock_begin_updating: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed
Error: couldn't get an RGB, Double-buffered visual
(hawk-session:87988): Gdk-CRITICAL **: 17:13:03.870: _gdk_frame_clock_freeze: assertion 'GDK_IS_FRAME_CLOCK (clock)' failed
(hawk-session:87988): Gdk-CRITICAL **: 17:13:03.871: _gdk_frame_clock_thaw: assertion 'GDK_IS_FRAME_CLOCK (clock)' failed
Aborted (core dumped)The Solution
To fix this, you must change your approach to creating the window manager. You should not use GtkPlug to create your main window frame. Instead, you need to follow the standard X11 window management paradigm. This involves:
-
Becoming the Window Manager: Your program must become the official window manager for the X server.
-
Listening for Window Events: Listen for events like MapRequest from other applications. When an application requests to show a new window, your window manager intercepts this request.
-
Reparenting: Create your own window (e.g., a standard GtkWindow or a custom X11 window) to act as the window frame (with the title bar, etc.). You then reparent the application's window to be a child of your newly created frame.