aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw
AgeCommit message (Collapse)AuthorFilesLines
2019-04-05devdraw: fix cocoa metal _flushmemscreen for invalid rectangles (#240)Xiao-Yong1-0/+4
It is possible to receive multiple screen resize events, and resizeimg would be called for different sizes, before _flushmemscreen actually gets called with rectangle sizes different from the most recent resizeimg call. The size mismatch would trigger illegal memory access inside _flushmemscreen. This commit protects _flushmemscreen by returning early if the requested rectangle is outside of the current texture rectangle.
2019-04-05devdraw: respond to windowDidBecomeKey on darwin (#239)Jacob Vosmaer1-0/+5
Fixes bug where devdraw does not "notice" mouse position after task switch. Fixes https://github.com/9fans/plan9port/issues/232.
2018-11-15devdraw: remove os x 10.5 compatibility codeJacob Vosmaer4-1790/+2
2018-11-15devdraw: add Cursor2 support on macOS 10.14 MojaveRuss Cox8-45/+113
This replaces the pixel-art scaling algorithm used for upscaling before. The results were not crisp enough to serve as everyday cursors.
2018-11-15devdraw: rewrite the Cocoa screen using MetalXiao-Yong Jin8-21/+1307
Add a new macOS cocoa screen, cocoa-screen-metal.m. Rewrite the macOS cocoa drawing code to use the builtin runloop, and use Metal to push pixels with CAMetalLayer. Remove all of the deprecated code, and simplify some of the logic. Modify mkwsysrules.sh such that the new code is used only when the system version is equal or higher than 10.14. Allow touch events to simulate mouse clicks: three finger tap for the middle mouse button; four finger tap for the 2-1 chord. Support Tresize. Scale 16x16 Cursor up to 32x32 with an EPX algorithm. Support macOS input sources including the basic dead keys and the advanced CJK input methods. Increase the communication buffers in cocoa-srv.c to allow more input, especially for long sentences prepared by the macOS input souces.
2018-11-14devdraw: set displaydpi on devdraw x11 attach (#178)Gabriel Díaz1-2/+7
See https://plan9port-review.googlesource.com/c/plan9/+/1470 for discussion of the approach, especially Michael Stapleberg's comment: Note that chromium, firefox and others have tried this and then switched to using the Xft.dpi X resource, see e.g. https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ui/libgtk2ui/gtk2_ui.cc and especially http://sources.debian.net/src/gnome-settings-daemon/3.18.2-1/plugins/xsettings/gsd-xsettings-manager.c/?hl=824#L80 for some anecdata about why this approach doesn’t work out. The Xft.dpi resource is being set accurately by desktop environments (GNOME, KDE, …) and can easily be changed by users of niche window managers by editing ~/.Xresources. I suggest we check only Xft.dpi, without considering the DPI environment variable or the monitor width/height.
2018-11-13devdraw: make ctrl generate 1-click while mouse down (#119)Xiao-Yong1-0/+2
This makes 2-1 chords possible with touchpad on a mac laptop.
2018-03-27devdraw: fix some memory leaks in x11Xiao-Yong Jin2-1/+5
2017-10-09devdraw: fix build on macOS < 10.12Rudá Moura1-0/+2
After making the build on macOS silent on commit 310ae03, the build was broken on macOS lesser than 10.12 (Sierra). This commit conditionally checks the version the of the SDK before using the defined values for silent build. Fixes #66.
2017-07-16devdraw: fix Mac Kcmd+ShiftRuss Cox1-0/+3
Change-Id: Ide32a9397701085b17fbd42f0866eb3de11e4190 Reviewed-on: https://plan9port-review.googlesource.com/2940 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-01-06all: fix or silence all INSTALL warnings on macOSRuss Cox3-63/+85
Should be a clean build now. Change-Id: Id3460371cb5e8d4071f8faa9c2aec870d213a067 Reviewed-on: https://plan9port-review.googlesource.com/2781 Reviewed-by: Russ Cox <rsc@swtch.com>
2015-11-11devdraw: cocoa: set window title on main threadsqweek1-2/+12
Change-Id: Ie818f9246f749a9d3293019a1e01be4ce7e368b9 Reviewed-on: https://plan9port-review.googlesource.com/1400 Reviewed-by: Russ Cox <rsc@swtch.com>
2015-06-03devdraw: plumb drag-n-dropped filesmarius a. eriksen1-0/+39
Change-Id: I7585870aee57c7482ebdd19c117be7982123ce79 Reviewed-on: https://plan9port-review.googlesource.com/1130 Reviewed-by: Russ Cox <rsc@google.com>
2015-02-17devdraw: enable retina behavior by default on OS XRuss Cox1-3/+3
Change-Id: I243a1fe3f9ec0841570c4cd69c02be9cfd9ade50 Reviewed-on: https://plan9port-review.googlesource.com/1172 Reviewed-by: Russ Cox <rsc@swtch.com>
2014-12-02devdraw: fix title and "open in top" on OS XRoi Martin1-1/+4
On OSX 10.10, when you open an application that depends on devdraw, the title bar only shows the first letter of the application's name. The patch sets a default title as soon as the window is created, which fixes this issue. On OSX 10.10, when you open an application that depends on devdraw, this application is opened in top of other windows, however the menu bar is not updated. The patch calls topwin() at the end of makewin() in src/cmd/devdraw/cocoa-screen.m . Change-Id: Ie036928b5574c8df20ad8b2b54047e2f7a22bb41 Reviewed-on: https://plan9port-review.googlesource.com/1091 Reviewed-by: Russ Cox <rsc@swtch.com>
2014-03-03fix gcc 4.8 warningsDavid du Colombier1-2/+1
LGTM=rsc R=rsc https://codereview.appspot.com/33240044
2014-01-22devdraw: clear altdown on focus out (thanks Ethan Burns)Russ Cox1-0/+1
TBR=rsc https://codereview.appspot.com/53820044
2013-08-06devdraw: set window name to argv[0]Russ Cox1-0/+120
R=rsc CC=r https://codereview.appspot.com/12577043
2013-07-17cmd/devdraw: clear keyboard state on lost focus.Roger Peppe1-0/+6
See https://bitbucket.org/rsc/plan9port/issue/128/alt-button-sticks-in-acme-sometimes-after R=rsc https://codereview.appspot.com/11453043
2013-06-21devdraw: fix x11 inputRuss Cox1-1/+1
R=rsc https://codereview.appspot.com/10458043
2013-03-07devdraw: control+click = button 2, alt/shift+click = button 3Russ Cox3-26/+111
For single-button mouse users. R=rsc https://codereview.appspot.com/7620043
2013-02-08devdraw: silence unused variable warningsRuss Cox1-2/+6
R=rsc https://codereview.appspot.com/7304064
2013-02-08devdraw: disable XCopyArea optimizationRuss Cox1-2/+5
Ubuntu Precise seems to have a buggy X server that sometimes fails at XCopyArea. Let devdraw do it itself. This will slow down remote X a little bit, but slow and correct is better than fast and broken. R=rsc https://codereview.appspot.com/7310069
2012-12-11fontsrv: fix build on OpenBSD 5.2Christian Kellermann1-0/+1
R=rsc CC=plan9port.codebot https://codereview.appspot.com/6850108
2012-11-25devdraw: fake dpi calculation on MacRuss Cox1-0/+8
R=rsc http://codereview.appspot.com/6782115
2012-11-25devdraw: use %R not Fn-F3 for retina toggleRuss Cox1-1/+1
R=rsc http://codereview.appspot.com/6854093
2012-11-25devdraw: add forcedpi toggled by Fn+F3 on MacRuss Cox4-3/+20
R=rsc http://codereview.appspot.com/6846104
2012-11-25devdraw: fix retina modeRuss Cox1-1/+1
R=rsc http://codereview.appspot.com/6847104
2012-11-25devdraw, libdraw: add display->dpiRuss Cox2-2/+28
Fixed at 100 right now, but the plan is to make it accurate and then use it. R=rsc http://codereview.appspot.com/6856091
2012-11-25devdraw: restore compilation on OS X 10.6Shenghou Ma1-0/+2
Also add some ignored files to .hgignore R=rsc http://codereview.appspot.com/6842089
2012-10-21plumb.app: accept plumb:foo as alias for fooRob Kroeger1-1/+16
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5495046
2012-10-21devdraw: map X11 dead_diaresis to double quoteCaio Oliveira1-39/+42
R=rsc CC=plan9port.codebot http://codereview.appspot.com/6690049
2012-10-21fix clang warnings reported by Tuncer AyazRuss Cox1-1/+1
R=rsc http://codereview.appspot.com/6744054
2012-10-20fix gcc 4.7 warnings (thanks Tuncer Ayaz)Russ Cox1-5/+1
R=rsc http://codereview.appspot.com/6744053
2012-10-16devdraw: MacBook retina supportRob Kroeger1-8/+121
Enable with export devdrawretina=1 (everything will be smaller). R=rsc CC=plan9port.codebot http://codereview.appspot.com/6592072
2012-10-07devdraw: prefer 24-bit over 15-bit or 16-bit.Russ Cox1-6/+6
Fixes remote X11 use via XQuartz 2.7.4. R=rsc http://codereview.appspot.com/6624058
2012-08-03devdraw: make it 3 times faster on OS XDavid Jeannot1-42/+49
This patch reverts the recent patch named "devdraw: fix for OS X 10.8", and fixes redrawing on OSX 10.8 differently, making scrolling under Acme 3 times faster. R=rsc, mirtchovski CC=plan9port.codebot http://codereview.appspot.com/6452087
2012-07-31devdraw: fix for OS X 10.8 (Mountain Lion)Rob Kroeger1-31/+40
In MacOS 10.8, the NSBitmapImageRep class appears to cache the specified image data at the time of construction. As a result updates to the backing memimage object do not get pushed to the screen in flushimg. This patch creates the NSBitmapImageRep object over again for each flushimg which would appear to fix the problem. R=rsc CC=plan9port.codebot http://codereview.appspot.com/6443063
2012-03-05devdraw: fix mouse warping with multi-monitor on OS XDavid Jeannot1-3/+3
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5748043
2012-03-05Devdraw now waits for the image: this means thatDavid Jeannot1-74/+226
there is no more blank image when toggling fullscreen, when unminimizing, or at startup; this also means that we can live resize, but we only enable live resizing with Page, because it seems useless for other apps, and Acme and Sam bug with it. The tradeoff is that bottom corners are sometimes automatically rounded. There is a way to prevent the rounding here: http://parmanoir.com/Custom_NSThemeFrame but this would obfuscate the code. Instead, we make sure that the corners are always rounded. Closing the window while its content is updated causes an exception, without this patch. This seems to happen regularly with stats(1). This patch avoids a possible deadlock at startup, which I never experienced. If I recollect right, there is little chance that this happens on a multi-core CPU. Minimizing now activates next app in line, and Devdraw now stops drawing while minimized. R=rsc CC=plan9port.codebot http://codereview.appspot.com/5499043
2012-03-05devdraw: fix winsize (-W) on OS XDavid Jeannot1-5/+11
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5749043
2012-02-28devdraw: fix fullscreen on LionRuss Cox1-1/+6
Now, if you full-screen an app running on a secondary screen, it only takes over that monitor. It does not cause the primary screen to disappear. Code by David Jeannot. R=djeannot24 http://codereview.appspot.com/5708046
2012-01-20devdraw: enable gestures on OS XDavid Jeannot1-183/+8
Remove swipe gestures. Keep only 2-finger pinching and 3-finger tapping. R=rsc CC=plan9port.codebot http://codereview.appspot.com/5498094
2012-01-19devdraw: make OS X resizer unobtrusiveDavid Jeannot1-4/+31
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5558051
2012-01-16devdraw: on OS X, add menu items "hide" and "plumb devdraw(1)"David Jeannot1-14/+22
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5505092
2012-01-16devdraw: OS X: neutralize menu and Dock bugs in fullscreen modeDavid Jeannot1-3/+9
Previously, the menu bar has been set to hidden instead of autohidden in fullscreen mode, because it appeared too easily. Occasionally however, it still appears. This patch makes sure it won't. With OS X Lion's fullscreen, the Dock is autohidden, but sometimes remains hidden. This bug comes with visual menu bar bugs during space transition and when exiting fullscreen. Those bugs happen after each Devdraw's activation, for example. This patch neutralizes them. R=rsc CC=plan9port.codebot http://codereview.appspot.com/5502091
2012-01-16devdraw: fix handling of compose key on OS XDavid Jeannot2-12/+15
This implementation is simpler to understand. It removes conflicts with other modifiers and with the virtual buttons. Pressing alt during a sequence now cancels it correctly. R=rsc CC=plan9port.codebot http://codereview.appspot.com/5507049
2012-01-16devdraw: remove old OS X codeDavid Jeannot5-1435/+0
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5528046
2012-01-16cocoa devdraw: activation on receiving Ttop messagesDavid Jeannot3-2/+17
(The new variable "willactivate" is in the input structure "in", which is illogical. But this structure will soon be renamed "app". I postpone the renaming to avoid conflicts with simultaneous Codereview issues.) R=rsc CC=plan9port.codebot http://codereview.appspot.com/5504102
2012-01-16devdraw: OS X dead key supportDavid Jeannot1-0/+19
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5503086