Wir entwickeln eine neue Linux -Desktop -Umgebung von Grund auf neu für das eigene Linux -Betriebssystem mit dem Namen Swiftos. Wir haben einen Fehler von "falschem Fensterverwaltungsparadigma" oder "unsachgemäßer Verwendung von GTKPLUG für einen Fenstermanager" auf Hawk Window Manager festgestellt. Der VNC -Server antwortete nicht, nachdem er eine Verbindung zum VNC -Server hergestellt hatte, da der VNC -Server ausgeschaltet wurde, nachdem die Desktop -Umgebung abgestürzt war. Bitte schlagen Sie den korrekten Code der ordnungsgemäßen Verwendung von GTK-Socket und GTK-Stecker vor.
git clone https://github.com/SwiftOS-Linux/hawk-desktop.git
cd hawk-desktop
< /code>
2. Kompilieren Sie dieses Projekt < /h3>
meson build
# meson compile -C build # For Release Version
meson compile --verbose -C build # For Debug Version
< /code>
cd build
sudo ninja install
< /code>
3. Debuggen Sie dieses Projekt < /h3>
Hinzufügen von Desktop-Umgebungsverknüpfungen < /p>
sudo bash -c 'cat > /usr/share/xsessions/hawk-desktop.desktop > /etc/lightdm/lightdm.conf.d/10-hawk.conf'
Wir entwickeln eine neue Linux -Desktop -Umgebung von Grund auf neu für das eigene Linux -Betriebssystem mit dem Namen Swiftos. Wir haben einen Fehler von "falschem Fensterverwaltungsparadigma" oder "unsachgemäßer Verwendung von GTKPLUG für einen Fenstermanager" auf Hawk Window Manager festgestellt. Der VNC -Server antwortete nicht, nachdem er eine Verbindung zum VNC -Server hergestellt hatte, da der VNC -Server ausgeschaltet wurde, nachdem die Desktop -Umgebung abgestürzt war. Bitte schlagen Sie den korrekten Code der ordnungsgemäßen Verwendung von GTK-Socket und GTK-Stecker vor.[code]#include #include #include #include #include #include #include #include #include #include #include #include "wm.h"
int is_window_maximized(Display *display, Window window) { Atom wm_state_atom; Atom maximized_horz_atom; Atom maximized_vert_atom;
// Get the atoms for the properties we are interested in. wm_state_atom = XInternAtom(display, "_NET_WM_STATE", False); maximized_horz_atom = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False); maximized_vert_atom = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
Atom actual_type; int actual_format; unsigned long nitems, bytes_after; unsigned char *prop_return = NULL;
// Get the _NET_WM_STATE property of the window. pthread_mutex_lock(&wm_mutex); if (XGetWindowProperty(display, window, wm_state_atom, 0, 1024, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytes_after, &prop_return) != Success) { pthread_mutex_unlock(&wm_mutex); return 0; } pthread_mutex_unlock(&wm_mutex);
if (actual_type != XA_ATOM || prop_return == NULL) { if (prop_return) XFree(prop_return); return 0; }
int is_max_horz = 0; int is_max_vert = 0;
// Iterate through the list of atoms to find the maximized states. Atom *atoms = (Atom *)prop_return; for (unsigned long i = 0; i < nitems; ++i) { if (atoms[i] == maximized_horz_atom) { is_max_horz = 1; } if (atoms[i] == maximized_vert_atom) { is_max_vert = 1; } }
XFree(prop_return);
// A window is considered maximized if both horizontal and vertical states are set. return is_max_horz && is_max_vert; }
int is_window_minimized(Display *display, Window window) { Atom wm_state_atom, wm_hidden_atom, actual_type; int actual_format; unsigned long nitems, bytes_after; unsigned char *states = NULL; int is_minimized = 0;
// Get the atom for _NET_WM_STATE wm_state_atom = XInternAtom(display, "_NET_WM_STATE", False); if (wm_state_atom == None) { fprintf(stderr, "Could not intern _NET_WM_STATE atom.\n"); return -1; }
// Get the atom for _NET_WM_STATE_HIDDEN wm_hidden_atom = XInternAtom(display, "_NET_WM_STATE_HIDDEN", False); if (wm_hidden_atom == None) { fprintf(stderr, "Could not intern _NET_WM_STATE_HIDDEN atom.\n"); return -1; }
// Get the _NET_WM_STATE property from the window pthread_mutex_lock(&wm_mutex); if (XGetWindowProperty( display, window, wm_state_atom, 0L, 1024L, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytes_after, &states ) == Success) { pthread_mutex_unlock(&wm_mutex); // Iterate through the list of states to find _NET_WM_STATE_HIDDEN if (actual_type == XA_ATOM && states != NULL) { Atom *state_atoms = (Atom *)states; for (unsigned long i = 0; i < nitems; ++i) { if (state_atoms[i] == wm_hidden_atom) { is_minimized = 1; break; } } }
if (states) { XFree(states); // Free the memory allocated by XGetWindowProperty } } else { pthread_mutex_unlock(&wm_mutex); return -1; // XGetWindowProperty failed }
return is_minimized; }
int is_window_closeable(Display *display, Window window) { Atom wm_protocols, wm_delete_window; Atom net_wm_allowed, net_wm_action_close; Atom *protocols = NULL; Atom *allowed_actions = NULL; int protocols_count = 0; int allowed_count = 0; int status; int is_closeable = 0;
// --- Check for WM_PROTOCOLS with WM_DELETE_WINDOW (ICCCM) --- wm_protocols = XInternAtom(display, "WM_PROTOCOLS", False); wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False);
if (wm_protocols != None && wm_delete_window != None) { pthread_mutex_lock(&wm_mutex); status = XGetWMProtocols(display, window, &protocols, &protocols_count); pthread_mutex_unlock(&wm_mutex); if (status) { for (int i = 0; i < protocols_count; i++) { if (protocols[i] == wm_delete_window) { is_closeable = 1; break; } } if (protocols) XFree(protocols); } }
// If already found to be closeable, the function stops here. if (is_closeable) return 1;
// --- Check for _NET_WM_ALLOWED_ACTIONS with _NET_WM_ACTION_CLOSE (EWMH) --- net_wm_allowed = XInternAtom(display, "_NET_WM_ALLOWED_ACTIONS", False); net_wm_action_close = XInternAtom(display, "_NET_WM_ACTION_CLOSE", False);
if (net_wm_allowed != None && net_wm_action_close != None) { Atom actual_type; int actual_format; unsigned long nitems, bytes_after; unsigned char *prop_ret = NULL;
pthread_mutex_lock(&wm_mutex); if (XGetWindowProperty( display, window, net_wm_allowed, 0L, 1024L, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytes_after, &prop_ret ) == Success) { pthread_mutex_unlock(&wm_mutex); if (actual_type == XA_ATOM && prop_ret) { allowed_actions = (Atom *)prop_ret; allowed_count = (int)nitems; for (int i = 0; i < allowed_count; i++) { if (allowed_actions[i] == net_wm_action_close) { is_closeable = 1; break; } } } if (prop_ret) XFree(prop_ret); } else { pthread_mutex_unlock(&wm_mutex); } }
return is_closeable; }
int is_window_maximizable(Display *display, Window window) { Atom net_wm_allowed_atom, max_vert_atom, max_horz_atom, actual_type; int actual_format; unsigned long nitems, bytes_after; unsigned char *prop_ret = NULL; int is_maximizable = 0;
// Get the atoms for the required properties net_wm_allowed_atom = XInternAtom(display, "_NET_WM_ALLOWED_ACTIONS", False); max_vert_atom = XInternAtom(display, "_NET_WM_ACTION_MAXIMIZE_VERT", False); max_horz_atom = XInternAtom(display, "_NET_WM_ACTION_MAXIMIZE_HORZ", False);
// Get the _NET_WM_ALLOWED_ACTIONS property from the window pthread_mutex_lock(&wm_mutex); if (XGetWindowProperty( display, window, net_wm_allowed_atom, 0L, 1024L, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytes_after, &prop_ret ) == Success) { pthread_mutex_unlock(&wm_mutex); // Iterate through the list of allowed actions to find maximization atoms if (actual_type == XA_ATOM && prop_ret != NULL) { Atom *actions = (Atom *)prop_ret; int has_vert = 0; int has_horz = 0;
for (unsigned long i = 0; i < nitems; ++i) { if (actions[i] == max_vert_atom) { has_vert = 1; } if (actions[i] == max_horz_atom) { has_horz = 1; } }
if (has_vert && has_horz) { is_maximizable = 1; } }
if (prop_ret) { XFree(prop_ret); // Free the memory allocated by XGetWindowProperty } } else { pthread_mutex_unlock(&wm_mutex); return -1; // XGetWindowProperty failed }
return is_maximizable; }
int is_window_minimizable(Display *display, Window window) { Atom net_wm_allowed_atom, min_atom, actual_type; int actual_format; unsigned long nitems, bytes_after; unsigned char *prop_ret = NULL; int is_minimizable = 0;
// Get the atoms for the required properties net_wm_allowed_atom = XInternAtom(display, "_NET_WM_ALLOWED_ACTIONS", False); min_atom = XInternAtom(display, "_NET_WM_ACTION_MINIMIZE", False);
if (net_wm_allowed_atom == None || min_atom == None) { fprintf(stderr, "Error: Failed to intern required atoms.\n"); return -1; }
// Get the _NET_WM_ALLOWED_ACTIONS property from the window pthread_mutex_lock(&wm_mutex); if (XGetWindowProperty( display, window, net_wm_allowed_atom, 0L, 1024L, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytes_after, &prop_ret ) == Success) { pthread_mutex_unlock(&wm_mutex); // Iterate through the list of allowed actions to find the minimize atom if (actual_type == XA_ATOM && prop_ret != NULL) { Atom *actions = (Atom *)prop_ret; for (unsigned long i = 0; i < nitems; ++i) { if (actions[i] == min_atom) { is_minimizable = 1; break; } } }
if (prop_ret) { XFree(prop_ret); // Free the memory allocated by XGetWindowProperty } } else { pthread_mutex_unlock(&wm_mutex); return -1; // XGetWindowProperty failed }
return is_minimizable; }
int is_title_bar_showing(Display *display, Window window) { if (!display || window == None) { return -1; }
Atom frame_extents_atom = XInternAtom(display, "_NET_FRAME_EXTENTS", False); if (frame_extents_atom == None) { return -1; }
Atom actual_type; int actual_format; unsigned long nitems, bytes_after; unsigned char *prop_ret = NULL; int is_title_bar = 0;
int status = XGetWindowProperty( display, window, frame_extents_atom, 0L, 4L, False, XA_CARDINAL, &actual_type, &actual_format, &nitems, &bytes_after, &prop_ret );
pthread_mutex_lock(&wm_mutex); XCloseDisplay(display); pthread_mutex_unlock(&wm_mutex); } [/code] Quellcode: https://github.com/swiftos-linux/hawk-desktop Wie man 1 beiträgt. Holen Sie sich den Quellcode < /h3> [code]git clone https://github.com/SwiftOS-Linux/hawk-desktop.git cd hawk-desktop < /code> 2. Kompilieren Sie dieses Projekt < /h3> meson build # meson compile -C build # For Release Version meson compile --verbose -C build # For Debug Version < /code> cd build sudo ninja install < /code> 3. Debuggen Sie dieses Projekt < /h3> Hinzufügen von Desktop-Umgebungsverknüpfungen < /p> sudo bash -c 'cat > /usr/share/xsessions/hawk-desktop.desktop > /etc/lightdm/lightdm.conf.d/10-hawk.conf' [/code]
Hier mein Problem: Der größte Teil des NAS von QNAP verfügt über eine Kopier -Taste auf der Vorderseite, neben einem USB-A-Port. Diese Taste wird den Inhalt eines beliebigen festen Antriebs an den...
Ich erstelle ein Autorisierungssystem in PHP und bin auf dieses Bearer-Schema zur Weitergabe von JWT-Token gestoßen, ich habe gelesen. Ich habe folgende Zweifel:
Ich möchte das Deap -Framework verwenden, um Tests mit dem Moving Peaks -Benchmark durchzuführen. Also kann ich die Algorithmen in einer dynamischen Umgebung testen.
Ich versuche, ein Programm zur Wertfunktion der Wertfunktion zu schreiben, und ich möchte den Nopython -Modus aus der Numba -Bibliothek verwenden. Der folgende Code tut wirklich nichts (ich wollte...