Advertisement
Guest User

Eclipse-Diff_4.21-4.22.log

a guest
Dec 15th, 2022
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.07 KB | None | 0 0
  1. diff --git a/Eclipse-R4_21/Control.java b/Eclipse-R4_22/Control.java
  2. index bfedd8d..d447596 100644
  3. --- a/Eclipse-R4_21/Control.java
  4. +++ b/Eclipse-R4_22/Control.java
  5. @@ -882,11 +882,7 @@ void forceResize () {
  6. gtk_widget_get_preferred_size (topHandle, requisition);
  7. GtkAllocation allocation = new GtkAllocation ();
  8. GTK.gtk_widget_get_allocation(topHandle, allocation);
  9. - if (GTK.GTK4) {
  10. - GTK4.gtk_widget_size_allocate (topHandle, allocation, -1);
  11. - } else {
  12. - GTK3.gtk_widget_size_allocate (topHandle, allocation);
  13. - }
  14. + gtk_widget_size_allocate(topHandle, allocation, -1);
  15. }
  16.  
  17. /**
  18. @@ -1070,7 +1066,7 @@ Point resizeCalculationsGTK3 (long widget, int width, int height) {
  19. }
  20.  
  21. int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
  22. - // bug in GTK2 crashes JVM, in GTK3 the new shell only. See bug 472743
  23. + // bug in GTK3 the crashes new shell only. See bug 472743
  24. width = Math.min(width, (2 << 14) - 1);
  25. height = Math.min(height, (2 << 14) - 1);
  26.  
  27. @@ -1153,11 +1149,7 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
  28. Control focusControl = display.getFocusControl();
  29. GTK.gtk_widget_show(topHandle);
  30. gtk_widget_get_preferred_size (topHandle, requisition);
  31. - if (GTK.GTK4) {
  32. - GTK4.gtk_widget_size_allocate (topHandle, allocation, -1);
  33. - } else {
  34. - GTK3.gtk_widget_size_allocate (topHandle, allocation);
  35. - }
  36. + gtk_widget_size_allocate(topHandle, allocation, -1);
  37. GTK.gtk_widget_hide(topHandle);
  38. /* Bug 540002: Showing and hiding widget causes original focused control to loose focus,
  39. * Reset focus to original focused control after dealing with allocation.
  40. @@ -5007,7 +4999,13 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
  41. sendOrPost(SWT.MouseDown, mouseDownEvent);
  42. }
  43. }
  44. - return true;
  45. + /* This checks for Wayland, a previous MouseDown || MouseMove in the
  46. + * dragDetectionQueue and it checks if the current event is MouseMove
  47. + * This will prevent them from not being queued, which caused
  48. + * Bug 576215 - [Wayland] Mouse events not received as on other platforms.
  49. + * In x11 this will always return true as before.
  50. + */
  51. + if( (OS.isX11() || (dragDetectionQueue == null) || (type != SWT.MouseMove)) ) return true;
  52. }
  53. Event event = new Event ();
  54. event.time = time;
  55. @@ -5039,7 +5037,6 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
  56.  
  57. /**
  58. * Bug 510446:
  59. - * In the original gtk2 DnD architecture, Drag detection was done in mouseDown.
  60. * For Wayland support, Drag detection is now done in mouseMove (as does gtk internally).
  61. *
  62. * However, traditionally external widgets (e.g StyledText or non-SWT widgets) expect to
  63. @@ -5052,7 +5049,7 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
  64. * - To ensure we follow 'send/post' contract as per parameter, we
  65. * temporarily utilize event.data to hold send/post flag.
  66. * There's also logic in place such that mouseDown/mouseMotion is always sent before mouseUp.
  67. - * - On Gtk2, mouseMove is sent during DnD. On Gtk3x11 it's not due to hacky implementation of DnD.
  68. + * - On Gtk3x11 it's not due to hacky implementation of DnD.
  69. * On Wayland mouseMove is once again sent during DnD as per improved architecture.
  70. */
  71. event.data = Boolean.valueOf(send);
  72. @@ -5875,11 +5872,7 @@ public boolean setParent (Composite parent) {
  73. allocation.y = y;
  74. allocation.width = width;
  75. allocation.height = height;
  76. - if (GTK.GTK4) {
  77. - GTK4.gtk_widget_size_allocate (topHandle, allocation, -1);
  78. - } else {
  79. - GTK3.gtk_widget_size_allocate (topHandle, allocation);
  80. - }
  81. + gtk_widget_size_allocate(topHandle, allocation, -1);
  82. this.parent = parent;
  83. setZOrder (null, false, true);
  84. reskin (SWT.ALL);
  85. diff --git a/Eclipse-R4_21/Display.java b/Eclipse-R4_22/Display.java
  86. index 74ea637..eea5afc 100644
  87. --- a/Eclipse-R4_21/Display.java
  88. +++ b/Eclipse-R4_22/Display.java
  89. @@ -1,5 +1,5 @@
  90. /*******************************************************************************
  91. - * Copyright (c) 2000, 2020 IBM Corporation and others.
  92. + * Copyright (c) 2000, 2021 IBM Corporation and others.
  93. *
  94. * This program and the accompanying materials
  95. * are made available under the terms of the Eclipse Public License 2.0
  96. @@ -127,6 +127,7 @@ public class Display extends Device {
  97. long fds;
  98. int allocated_nfds;
  99. boolean wake;
  100. + boolean windowSizeSet;
  101. int [] max_priority = new int [1], timeout = new int [1];
  102. Callback eventCallback;
  103. long eventProc, windowProc2, windowProc3, windowProc4, windowProc5, windowProc6;
  104. @@ -134,9 +135,10 @@ public class Display extends Device {
  105. long snapshotDrawProc, keyPressReleaseProc, focusProc, enterMotionProc, leaveProc,
  106. scrollProc, resizeProc, activateProc, gesturePressReleaseProc;
  107. long notifyProc;
  108. + long computeSizeProc;
  109. Callback windowCallback2, windowCallback3, windowCallback4, windowCallback5, windowCallback6;
  110. Callback changeValue;
  111. - Callback snapshotDraw, keyPressReleaseCallback, focusCallback, enterMotionCallback,
  112. + Callback snapshotDraw, keyPressReleaseCallback, focusCallback, enterMotionCallback, computeSizeCallback,
  113. scrollCallback, leaveCallback, resizeCallback, activateCallback, gesturePressReleaseCallback;
  114. Callback notifyCallback;
  115. EventTable eventTable, filterTable;
  116. @@ -225,13 +227,13 @@ public class Display extends Device {
  117. * other areas of SWT (i.e. WebKit). See bug 540060.
  118. */
  119. /** @noreference */
  120. - public ArrayList<Long> dBusServers = new ArrayList<>();
  121. + public java.util.List<Long> dBusServers = new ArrayList<>();
  122. /** @noreference */
  123. - public ArrayList<Long> dBusAuthObservers = new ArrayList<>();
  124. + public java.util.List<Long> dBusAuthObservers = new ArrayList<>();
  125. /** @noreference */
  126. - public ArrayList<Long> dBusGUIDS = new ArrayList<>();
  127. + public java.util.List<Long> dBusGUIDS = new ArrayList<>();
  128. /** @noreference */
  129. - public ArrayList<Long> dBusConnections = new ArrayList<>();
  130. + public java.util.List<Long> dBusConnections = new ArrayList<>();
  131.  
  132. /* Deferred Layout list */
  133. Composite[] layoutDeferred;
  134. @@ -859,7 +861,7 @@ void addPopup (Menu menu) {
  135.  
  136. void addSkinnableWidget (Widget widget) {
  137. if (skinCount >= skinList.length) {
  138. - Widget[] newSkinWidgets = new Widget [skinList.length + GROW_SIZE];
  139. + Widget[] newSkinWidgets = new Widget [(skinList.length + 1) * 3 / 2];
  140. System.arraycopy (skinList, 0, newSkinWidgets, 0, skinList.length);
  141. skinList = newSkinWidgets;
  142. }
  143. @@ -1156,6 +1158,7 @@ void createDisplay (DeviceData data) {
  144. GDK.gdk_threads_enter ();
  145. }
  146. boolean init;
  147. + windowSizeSet = false;
  148. if (GTK.GTK4) {
  149. init = GTK4.gtk_init_check();
  150. } else {
  151. @@ -3532,6 +3535,7 @@ void initializeCallbacks () {
  152. signalIds [Widget.MAP_EVENT] = OS.g_signal_lookup (OS.map_event, GTK.GTK_TYPE_WIDGET ());
  153. signalIds [Widget.MNEMONIC_ACTIVATE] = OS.g_signal_lookup (OS.mnemonic_activate, GTK.GTK_TYPE_WIDGET ());
  154. signalIds [Widget.MOTION_NOTIFY_EVENT] = OS.g_signal_lookup (OS.motion_notify_event, GTK.GTK_TYPE_WIDGET ());
  155. + signalIds [Widget.COMPUTE_SIZE] = OS.g_signal_lookup(OS.compute_size, GTK.GTK_TYPE_WIDGET() );
  156. /*
  157. * Connect to the "popped-up" signal on GTK3.22+ if the user has specified the
  158. * SWT_MENU_LOCATION_DEBUGGING environment variable.
  159. @@ -3589,6 +3593,9 @@ void initializeCallbacks () {
  160.  
  161. activateCallback = new Callback(this, "activateProc", void.class, new Type[] {long.class, long.class, long.class}); //$NON-NLS-1$
  162. activateProc = activateCallback.getAddress();
  163. +
  164. + computeSizeCallback = new Callback(this, "computeSizeProc", void.class, new Type[] {long.class, long.class, long.class}); //$NON-NLS-1$
  165. + computeSizeProc = computeSizeCallback.getAddress();
  166. }
  167.  
  168. notifyCallback = new Callback(this, "notifyProc", long.class, new Type[] {
  169. @@ -3664,7 +3671,6 @@ void initializeCallbacks () {
  170. closuresProc [Widget.TOGGLED] = windowProc3;
  171. closuresProc [Widget.UNMAP_EVENT] = windowProc3;
  172. closuresProc [Widget.WINDOW_STATE_EVENT] = windowProc3;
  173. - closuresProc [Widget.ROW_DELETED] = windowProc3;
  174. closuresProc [Widget.DIRECTION_CHANGED] = windowProc3;
  175.  
  176. windowCallback4 = new Callback (this, "windowProc", 4); //$NON-NLS-1$
  177. @@ -3679,7 +3685,6 @@ void initializeCallbacks () {
  178. closuresProc [Widget.SWITCH_PAGE] = windowProc4;
  179. closuresProc [Widget.TEST_COLLAPSE_ROW] = windowProc4;
  180. closuresProc [Widget.TEST_EXPAND_ROW] = windowProc4;
  181. - closuresProc [Widget.ROW_INSERTED] = windowProc4;
  182. closuresProc [Widget.ROW_HAS_CHILD_TOGGLED] = windowProc4;
  183. closuresProc [Widget.DELETE_FROM_CURSOR] = windowProc4;
  184. closuresProc [Widget.DELETE_FROM_CURSOR_INVERSE] = windowProc4;
  185. @@ -5079,12 +5084,7 @@ String dumpWidgetTableInfo() {
  186. for (int i = 0; i < widgetTable.length; i++) {
  187. Widget w = widgetTable[i];
  188. if (w != null && w.isDisposed()) {
  189. - Collection<Integer> list = disposed.get(w);
  190. - if (list == null) {
  191. - list = new ArrayList<>();
  192. - disposed.put(w, list);
  193. - }
  194. - list.add(Integer.valueOf(i));
  195. + disposed.computeIfAbsent(w, k -> new ArrayList<>()).add(Integer.valueOf(i));
  196. }
  197. }
  198. if (!disposed.isEmpty()) {
  199. @@ -5287,6 +5287,17 @@ public static void setAppVersion (String version) {
  200. * @since 2.1
  201. */
  202. public void setCursorLocation (int x, int y) {
  203. + /*
  204. + * Wayland does not support mouse warping, thus setCursorLocation
  205. + * is not supported due to gdk_device_warp not being implemented
  206. + * in Wayland. There currently is no good solution that could be
  207. + * implemented, so a log entry was determined to be sufficient.
  208. + *
  209. + * See Bug 577099
  210. + */
  211. + if(!OS.isX11()) {
  212. + System.err.println("SWT Display.java Error: setCursorLocation only supported on X11. \n");
  213. + }
  214. setCursorLocation(new Point (x, y));
  215. }
  216.  
  217. @@ -6001,6 +6012,41 @@ public void syncExec (Runnable runnable) {
  218. synchronizer.syncExec (runnable);
  219. }
  220.  
  221. +/**
  222. + * Calls the callable in the user-interface thread and returns the supplied value.
  223. + * The callable may throw checked Exception. Any Exception is rethrown in the calling thread.
  224. + *
  225. + * @param callable the code to run on the user-interface thread
  226. + *
  227. + * @exception SWTException <ul>
  228. + * <li>ERROR_FAILED_EXEC - if an exception occurred when executing the runnable</li>
  229. + * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  230. + * </ul>
  231. + *
  232. + * @see #syncExec(Runnable)
  233. + * @see SwtCallable#call()
  234. + * @since 3.118
  235. + */
  236. +public <T, E extends Exception> T syncCall(SwtCallable<T, E> callable) throws E {
  237. + Objects.nonNull(callable);
  238. + @SuppressWarnings("unchecked")
  239. + T[] t = (T[]) new Object[1];
  240. + Object[] ex = new Object[1];
  241. + syncExec(() -> {
  242. + try {
  243. + t[0] = callable.call();
  244. + } catch (Exception e) {
  245. + ex[0] = e;
  246. + }
  247. + });
  248. + if (ex[0] != null) {
  249. + @SuppressWarnings("unchecked")
  250. + E e = (E) ex[0];
  251. + throw e;
  252. + }
  253. + return t[0];
  254. +}
  255. +
  256. static int translateKey (int key) {
  257. for (int i=0; i<KeyTable.length; i++) {
  258. if (KeyTable [i] [0] == key) return KeyTable [i] [1];
  259. @@ -6100,6 +6146,10 @@ void leaveProc(long controller, long user_data) {
  260. if (widget != null) widget.leaveProc(controller, handle, user_data);
  261. }
  262.  
  263. +void computeSizeProc(long toplevel, long size, long user_data) {
  264. + //TODO: GTK4 - Could be needed for minimum Size, signal remains connected
  265. +}
  266. +
  267. void activateProc(long action, long parameter, long user_data) {
  268. Widget widget = getWidget(user_data);
  269. if(widget == null) return;
  270. diff --git a/Eclipse-R4_21/SWT.java b/Eclipse-R4_22/SWT.java
  271. index 35d5860..5dadc75 100644
  272. --- a/Eclipse-R4_21/SWT.java
  273. +++ b/Eclipse-R4_22/SWT.java
  274. @@ -1020,6 +1020,20 @@ public class SWT {
  275. */
  276. public static final int ZoomChanged = 55;
  277.  
  278. + /**
  279. + * The SWT emptiness change event type (value is 56).
  280. + *
  281. + * <p>
  282. + * This event is sent on <code>Tree</code> when the first <code>TreeItem</code> was
  283. + * added to it (with the <code>detail</code> field set to 0) or the last
  284. + * <code>TreeItem</code> was removed from it (with the <code>detail</code> field
  285. + * set to 1).
  286. + * </p>
  287. + *
  288. + * @since 3.118
  289. + */
  290. + public static final int EmptinessChanged = 56;
  291. +
  292. /* Event Details */
  293.  
  294. /**
  295.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement