Skip to content

Commit db811ef

Browse files
Fixed Hyprland support
1 parent 72a2b17 commit db811ef

108 files changed

Lines changed: 2060 additions & 6054 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/Packages/System.IO.Pipelines.8.0.0/lib/netstandard2.0/System.IO.Pipelines.xml.meta renamed to Assets/AddressableAssetsData/link.xml.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MATE ENGINE - Scenes/Mate Engine Main.unity

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11823,6 +11823,50 @@ MonoBehaviour:
1182311823
m_ChildScaleWidth: 0
1182411824
m_ChildScaleHeight: 0
1182511825
m_ReverseArrangement: 0
11826+
--- !u!1 &763844364
11827+
GameObject:
11828+
m_ObjectHideFlags: 0
11829+
m_CorrespondingSourceObject: {fileID: 0}
11830+
m_PrefabInstance: {fileID: 0}
11831+
m_PrefabAsset: {fileID: 0}
11832+
serializedVersion: 6
11833+
m_Component:
11834+
- component: {fileID: 763844365}
11835+
- component: {fileID: 763844366}
11836+
m_Layer: 0
11837+
m_Name: KWinManager
11838+
m_TagString: Untagged
11839+
m_Icon: {fileID: 0}
11840+
m_NavMeshLayer: 0
11841+
m_StaticEditorFlags: 0
11842+
m_IsActive: 1
11843+
--- !u!4 &763844365
11844+
Transform:
11845+
m_ObjectHideFlags: 0
11846+
m_CorrespondingSourceObject: {fileID: 0}
11847+
m_PrefabInstance: {fileID: 0}
11848+
m_PrefabAsset: {fileID: 0}
11849+
m_GameObject: {fileID: 763844364}
11850+
serializedVersion: 2
11851+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
11852+
m_LocalPosition: {x: 0, y: 0, z: 0}
11853+
m_LocalScale: {x: 1, y: 1, z: 1}
11854+
m_ConstrainProportionsScale: 0
11855+
m_Children: []
11856+
m_Father: {fileID: 1395823394}
11857+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
11858+
--- !u!114 &763844366
11859+
MonoBehaviour:
11860+
m_ObjectHideFlags: 0
11861+
m_CorrespondingSourceObject: {fileID: 0}
11862+
m_PrefabInstance: {fileID: 0}
11863+
m_PrefabAsset: {fileID: 0}
11864+
m_GameObject: {fileID: 763844364}
11865+
m_Enabled: 1
11866+
m_EditorHideFlags: 0
11867+
m_Script: {fileID: 11500000, guid: 1a4f6c01488165be28604d232e16219a, type: 3}
11868+
m_Name:
11869+
m_EditorClassIdentifier: Assembly-CSharp::KWinManager
1182611870
--- !u!1 &769857069
1182711871
GameObject:
1182811872
m_ObjectHideFlags: 0
@@ -11851,7 +11895,7 @@ Light:
1185111895
serializedVersion: 11
1185211896
m_Type: 2
1185311897
m_Color: {r: 1, g: 0.26999998, b: 0.96203995, a: 1}
11854-
m_Intensity: 1.6560647e-15
11898+
m_Intensity: 1.1635721e-15
1185511899
m_Range: 0.5
1185611900
m_SpotAngle: 30
1185711901
m_InnerSpotAngle: 21.80208
@@ -45112,7 +45156,7 @@ Light:
4511245156
serializedVersion: 11
4511345157
m_Type: 2
4511445158
m_Color: {r: 0, g: 0.44799995, b: 1, a: 1}
45115-
m_Intensity: 3.3121294e-15
45159+
m_Intensity: 2.3271442e-15
4511645160
m_Range: 1
4511745161
m_SpotAngle: 30
4511845162
m_InnerSpotAngle: 21.80208
@@ -54409,7 +54453,7 @@ Light:
5440954453
serializedVersion: 11
5441054454
m_Type: 2
5441154455
m_Color: {r: 0, g: 0.44799995, b: 1, a: 1}
54412-
m_Intensity: 2.4840971e-15
54456+
m_Intensity: 1.7453582e-15
5441354457
m_Range: 1
5441454458
m_SpotAngle: 30
5441554459
m_InnerSpotAngle: 21.80208
@@ -54761,6 +54805,7 @@ Transform:
5476154805
- {fileID: 9167954367735630932}
5476254806
- {fileID: 1520083670}
5476354807
- {fileID: 222295048}
54808+
- {fileID: 763844365}
5476454809
m_Father: {fileID: 0}
5476554810
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
5476654811
--- !u!1 &1409192894
@@ -56301,6 +56346,11 @@ MonoBehaviour:
5630156346
handlerObject: {fileID: 8199926937260908627}
5630256347
toggleField: enableWindowSittingToggle
5630356348
methodName: LoadSettings
56349+
- label: Force Stop Dragging
56350+
type: 2
56351+
handlerObject: {fileID: 9167954367735630936}
56352+
toggleField: enableWindowSittingToggle
56353+
methodName: ForceStopDragging
5630456354
--- !u!114 &1520083672
5630556355
MonoBehaviour:
5630656356
m_ObjectHideFlags: 0
@@ -167367,7 +167417,7 @@ MonoBehaviour:
167367167417
groupID: ambi_lights
167368167418
exclusiveTags:
167369167419
- lights
167370-
fadeCurrentValue: 8.2803236e-16
167420+
fadeCurrentValue: 5.8178606e-16
167371167421
fadeTarget: 0
167372167422
isFading: 1
167373167423
hasYSet: 0
@@ -167391,7 +167441,7 @@ MonoBehaviour:
167391167441
groupID: ambi_lights
167392167442
exclusiveTags:
167393167443
- lights
167394-
fadeCurrentValue: 8.2803236e-16
167444+
fadeCurrentValue: 5.8178606e-16
167395167445
fadeTarget: 0
167396167446
isFading: 1
167397167447
hasYSet: 0
@@ -167415,7 +167465,7 @@ MonoBehaviour:
167415167465
groupID: ambi_lights
167416167466
exclusiveTags:
167417167467
- lights
167418-
fadeCurrentValue: 8.2803236e-16
167468+
fadeCurrentValue: 5.8178606e-16
167419167469
fadeTarget: 0
167420167470
isFading: 1
167421167471
hasYSet: 0
@@ -167931,7 +167981,6 @@ MonoBehaviour:
167931167981
m_Name:
167932167982
m_EditorClassIdentifier:
167933167983
desktopScale: 1
167934-
snapZoneOffset: {x: 0, y: -5}
167935167984
snapThreshold: 30
167936167985
totalWindowSitAnimations: 9
167937167986
windowSitYOffset: 0
@@ -195421,7 +195470,6 @@ MonoBehaviour:
195421195470
m_Name:
195422195471
m_EditorClassIdentifier:
195423195472
desktopScale: 1
195424-
snapZoneOffset: {x: 0, y: -5}
195425195473
snapThreshold: 30
195426195474
totalWindowSitAnimations: 9
195427195475
windowSitYOffset: 0
@@ -197425,7 +197473,7 @@ MonoBehaviour:
197425197473
m_Name:
197426197474
m_EditorClassIdentifier:
197427197475
m_Material: {fileID: 0}
197428-
m_Color: {r: 0, g: 0, b: 0, a: 0}
197476+
m_Color: {r: 1, g: 1, b: 1, a: 0}
197429197477
m_RaycastTarget: 1
197430197478
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
197431197479
m_Maskable: 1
@@ -197565,7 +197613,6 @@ MonoBehaviour:
197565197613
m_Script: {fileID: 11500000, guid: f20133451b8bf43c9809426b8c4c4c16, type: 3}
197566197614
m_Name:
197567197615
m_EditorClassIdentifier: Assembly-CSharp::X11.X11Manager
197568-
isDragging: 0
197569197616
--- !u!224 &9169863018140061722
197570197617
RectTransform:
197571197618
m_ObjectHideFlags: 0

Assets/MATE ENGINE - Scripts/APIs/EarlyEnvSet.cs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,45 @@
55
using Gtk;
66
using Unity.Collections;
77
using UnityEngine;
8-
using X11;
98
using Debug = UnityEngine.Debug;
109

1110
public static class EarlyEnvSet
1211
{
1312
[DllImport("libc")]
1413
private static extern IntPtr setenv(string name, string value, int overwrite);
1514

16-
[DllImport(X11Manager.LibX11)]
17-
private static extern int XGetWindowAttributes(IntPtr display, IntPtr window, out X11Manager.XWindowAttributes attributes);
15+
[DllImport(WindowManager.LibX11)]
16+
private static extern int XGetWindowAttributes(IntPtr display, IntPtr window, out WindowManager.XWindowAttributes attributes);
1817

19-
[DllImport(X11Manager.LibXRender)]
18+
[DllImport(WindowManager.LibXRender)]
2019
private static extern IntPtr XRenderFindVisualFormat(IntPtr display, IntPtr visual);
2120

22-
[DllImport(X11Manager.LibX11)]
21+
[DllImport(WindowManager.LibX11)]
2322
private static extern IntPtr XOpenDisplay(string displayName);
2423

25-
[DllImport(X11Manager.LibX11)]
24+
[DllImport(WindowManager.LibX11)]
2625
private static extern IntPtr XInternAtom(IntPtr display, string atomName, bool onlyIfExists);
2726

28-
[DllImport(X11Manager.LibX11)]
27+
[DllImport(WindowManager.LibX11)]
2928
private static extern IntPtr XDefaultRootWindow(IntPtr display);
3029

31-
[DllImport(X11Manager.LibX11)]
30+
[DllImport(WindowManager.LibX11)]
3231
private static extern bool XTranslateCoordinates(IntPtr display, IntPtr srcW, IntPtr destW,
3332
int srcX, int srcY, out int destX, out int destY, out IntPtr child);
3433

35-
[DllImport(X11Manager.LibX11)]
34+
[DllImport(WindowManager.LibX11)]
3635
private static extern int XGetWindowProperty(IntPtr display, IntPtr window, IntPtr property,
3736
long longOffset, long longLength, bool delete, IntPtr reqType,
3837
out IntPtr actualTypeReturn, out int actualFormatReturn,
3938
out ulong nItemsReturn, out ulong bytesAfterReturn, out IntPtr propReturn);
4039

41-
[DllImport(X11Manager.LibX11)]
40+
[DllImport(WindowManager.LibX11)]
4241
private static extern int XGetSelectionOwner(IntPtr display, IntPtr atom);
4342

44-
[DllImport(X11Manager.LibX11)]
43+
[DllImport(WindowManager.LibX11)]
4544
private static extern int XScreenCount(IntPtr display);
4645

47-
[DllImport(X11Manager.LibX11)]
46+
[DllImport(WindowManager.LibX11)]
4847
private static extern int XFree(IntPtr data);
4948

5049

@@ -142,7 +141,7 @@ private static bool IsArgbVisual(IntPtr display, IntPtr visual)
142141
IntPtr formatPtr = XRenderFindVisualFormat(display, visual);
143142
if (formatPtr == IntPtr.Zero) return false;
144143

145-
X11Manager.XRenderPictFormat format = Marshal.PtrToStructure<X11Manager.XRenderPictFormat>(formatPtr);
144+
WindowManager.XRenderPictFormat format = Marshal.PtrToStructure<WindowManager.XRenderPictFormat>(formatPtr);
146145
return format.type == 1 && format.direct.alphaMask != 0;
147146
}
148147

@@ -192,7 +191,7 @@ private static bool IsWindowVisible(IntPtr display, IntPtr rootWindow, IntPtr wi
192191
{
193192
if (display == IntPtr.Zero) return false;
194193

195-
int result = XGetWindowAttributes(display, window, out X11Manager.XWindowAttributes attr);
194+
int result = XGetWindowAttributes(display, window, out WindowManager.XWindowAttributes attr);
196195
if (result == 0 || attr.map_state != 2) return false;
197196

198197
if (!XTranslateCoordinates(display, window, rootWindow, 0, 0, out int absX, out int absY, out _))
@@ -212,7 +211,7 @@ private static bool IsWindowVisible(IntPtr display, IntPtr rootWindow, IntPtr wi
212211
for (int i = index + 1; i < stacking.Count; i++)
213212
{
214213
IntPtr ow = stacking[i];
215-
XGetWindowAttributes(display, ow, out X11Manager.XWindowAttributes oattr);
214+
XGetWindowAttributes(display, ow, out WindowManager.XWindowAttributes oattr);
216215
if (oattr.map_state != 2) continue;
217216

218217
if (!XTranslateCoordinates(display, ow, rootWindow, 0, 0, out int oabsX, out int oabsY, out _))
@@ -236,13 +235,13 @@ private static bool IsWindowVisible(IntPtr display, IntPtr rootWindow, IntPtr wi
236235
if (coversList.Count == 0) return true;
237236

238237
// Burst-optimized union area computation
239-
NativeArray<X11Manager.RectF> covers = new NativeArray<X11Manager.RectF>(coversList.Count, Allocator.Temp);
238+
NativeArray<WindowManager.RectF> covers = new NativeArray<WindowManager.RectF>(coversList.Count, Allocator.Temp);
240239
for (int i = 0; i < coversList.Count; i++)
241240
{
242241
var t = coversList[i];
243-
covers[i] = new X11Manager.RectF { x1 = t.x1, y1 = t.y1, x2 = t.x2, y2 = t.y2 };
242+
covers[i] = new WindowManager.RectF { x1 = t.x1, y1 = t.y1, x2 = t.x2, y2 = t.y2 };
244243
}
245-
float coveredArea = X11Manager.UnionAreaCalculator.Compute(covers);
244+
float coveredArea = WindowManager.UnionAreaCalculator.Compute(covers);
246245
covers.Dispose();
247246

248247
return coveredArea < targetArea - 1e-4f;

Assets/MATE ENGINE - Scripts/APIs/GtkX11Helper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Runtime.InteropServices;
33
using Gdk;
4-
using X11;
54

65
public class GtkX11Helper
76
{

0 commit comments

Comments
 (0)