From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Tor-bj=C3=B6rn?= Claesson Newsgroups: gmane.emacs.bugs Subject: bug#70138: Do not intercept C-TAB on Haiku OS Date: Wed, 03 Apr 2024 18:25:44 +0300 Message-ID: <87r0fma2kl.fsf@barbar> References: <87sf033omt.fsf@yahoo.com> <87cyr6bzfd.fsf@barbar> <87cyr636eb.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27725"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.13; emacs 29.2 Cc: 70138@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 03 17:29:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rs2YA-0006tV-5a for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Apr 2024 17:29:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rs2Xv-0005Y0-47; Wed, 03 Apr 2024 11:29:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rs2Xr-0005SX-Pv for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 11:28:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rs2Xr-0001jJ-Ff for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 11:28:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rs2Xv-0004pI-Ri for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 11:29:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Tor-bj=C3=B6rn?= Claesson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Apr 2024 15:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70138 X-GNU-PR-Package: emacs Original-Received: via spool by 70138-submit@debbugs.gnu.org id=B70138.171215809518296 (code B ref 70138); Wed, 03 Apr 2024 15:29:03 +0000 Original-Received: (at 70138) by debbugs.gnu.org; 3 Apr 2024 15:28:15 +0000 Original-Received: from localhost ([127.0.0.1]:59363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs2X8-0004kv-12 for submit@debbugs.gnu.org; Wed, 03 Apr 2024 11:28:15 -0400 Original-Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:57575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs2X4-0004jx-Cg for 70138@debbugs.gnu.org; Wed, 03 Apr 2024 11:28:12 -0400 Original-Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-516bfcc775bso1009063e87.2 for <70138@debbugs.gnu.org>; Wed, 03 Apr 2024 08:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712158079; x=1712762879; darn=debbugs.gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=vxQiVYXQHQFLp+IEHQu5jbC8JRIRjcnyihdvofYQgR4=; b=TbrGJvbl59qPyTttG/qc7HcQB08MvL3MPd0W7L1HsD8zW9MicGJkaSPOaC0Vm1TuYJ O7YEQL1WgDNdyMF2OeELmjtbdYlQSO3hCt3GT0NeQw+r6c41whTejYrzaDR1YvFgUmDP 1I+3dOHm7sOmbjKxzYnHmH5QIpG/8jExL674wKXzs4iajP2MSd9K2zhBxin2V1ERQtdN TTrGf6fdTT2HTyK85Il7sNF1fpQjFPdwe6d96JZsI+d4FpY8dsVu/Tvn2oEJD07RDj+1 dWGRg+Cjn8YujQPmfG0h9M1oRupGpVaaBZHt7ofHJnZyKfwqtnd9wAaus0oEosF2gqEe 27pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712158079; x=1712762879; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vxQiVYXQHQFLp+IEHQu5jbC8JRIRjcnyihdvofYQgR4=; b=Cm/Ey95WRPdLlqek+n+5DjPD6T9LP4Z90J8fGum5R1YoNiTqq5qLhdfYcLZUQjs+yl l7WK1eJrpi2aaOiXFrhZSw5VkjBJf0OoLgH/1qfuQS0xnL7Qdd/xUtS69yPl1GoZeIYW KRI8ksi/FRkQRuvxuci6CLJhnET6CKWu91on8oIDLN0CwiqtWkcMGNC3RTjA8YsR6GhM dfSyetcpierefDlYbk4oJzmQc7xyKcKSyioz9Ef/ngPbTu9gUujbX6i8peE5phNRTY5l bugQ7MhXsahUBQfdwP/1JZgxZ4cEe/t112ZghOWbqUrpHGTw2MAYKzdRZxXMKDrN2v/g gUbg== X-Gm-Message-State: AOJu0Yz37xu0cJExLHYDTOVgy02CB8wOqF3qP/eY60uYjBRWHkNqDyY5 N5SfV5UehYQ1XtdUUoQU7CD8Zg0dvnbIww/v3PFQBabD9A5oJPjnelVvIY4b X-Google-Smtp-Source: AGHT+IE7+ziF46alJm8SUHPzUgYpz0FFXf2u/BCxxtUxoDqbj6luRARIBI5Tzb9KFMM/8/MbzVvg1A== X-Received: by 2002:a05:6512:b99:b0:516:9e8f:d92e with SMTP id b25-20020a0565120b9900b005169e8fd92emr12327728lfv.10.1712158079040; Wed, 03 Apr 2024 08:27:59 -0700 (PDT) Original-Received: from barbar (212-90-87-175.bb.dnainternet.fi. [212.90.87.175]) by smtp.gmail.com with ESMTPSA id d12-20020ac24c8c000000b00515c2c5c467sm2049092lfl.167.2024.04.03.08.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:27:55 -0700 (PDT) In-reply-to: <87cyr636eb.fsf@yahoo.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282573 Archived-At: --=-=-= Content-Type: text/plain Hi! Thanks, well spotted! Here is a new version of the patch. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-New-variable-haiku-pass-control-tab-to-system-rev2.patch >From 7ae1155360c1c8807809c7427b96192535627811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= Date: Wed, 3 Apr 2024 10:25:59 +0300 Subject: [PATCH] New variable haiku-pass-control-tab-to-system Allow passing C-TAB on to the Haiku operating system, fixing window switching when an Emacs frame has focus (Bug#70138). * src/haiku_support.cc (DispatchMessage): Conditionally pass message to BWindow. * src/haiku_support.h: * src/haikufns.c (haiku_should_pass_control_tab_to_system): Add variable haiku-pass-control-tab-to-system, and C function haiku_should_pass_control_tab_to_system. Co-authored-by: Po Lu Copyright-paperwork-exempt: yes --- etc/NEWS | 5 +++++ src/haiku_support.cc | 7 +++++++ src/haiku_support.h | 2 ++ src/haikufns.c | 14 ++++++++++++++ 4 files changed, 28 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 2654d9d7995..32cec82f970 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1916,6 +1916,11 @@ The new function 'haiku-notifications-notify' provides a subset of the capabilities of the 'notifications-notify' function in a manner analogous to 'w32-notification-notify'. +** New variable 'haiku-pass-control-tab-to-system'. +This sets whether Emacs should pass C-TAB on to the system instead of +handling it, fixing a problem where window switching would not activate +if an Emacs frame had focus on the Haiku operation system. + +++ ** New value 'if-regular' for the REPLACE argument to 'insert-file-contents'. It results in 'insert-file-contents' erasing the buffer instead of diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 1b9c5acdf14..a87ba0a08e3 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1063,6 +1063,13 @@ class EmacsWindow : public BWindow uint32_t mods = modifiers (); + if (haiku_should_pass_control_tab_to_system() + && (mods & B_CONTROL_KEY) && key == 38) + { + BWindow::DispatchMessage (msg, handler); + return; + } + if (mods & B_SHIFT_KEY) rq.modifiers |= HAIKU_MODIFIER_SHIFT; diff --git a/src/haiku_support.h b/src/haiku_support.h index e9ac7005d75..6c0e5fa7acd 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -691,6 +691,8 @@ extern int be_get_display_color_cells (void); extern bool be_is_display_grayscale (void); extern void be_warp_pointer (int, int); +extern bool haiku_should_pass_control_tab_to_system (void); + extern void EmacsView_set_up_double_buffering (void *); extern void EmacsView_disable_double_buffering (void *); extern void EmacsView_flip_and_blit (void *); diff --git a/src/haikufns.c b/src/haikufns.c index 173c1e369df..a9bfa5b61e1 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -2194,6 +2194,12 @@ haiku_set_use_frame_synchronization (struct frame *f, Lisp_Object arg, be_set_use_frame_synchronization (FRAME_HAIKU_VIEW (f), !NILP (arg)); } +bool +haiku_should_pass_control_tab_to_system (void) +{ + return haiku_pass_control_tab_to_system; +} + DEFUN ("haiku-set-mouse-absolute-pixel-position", @@ -3302,6 +3308,14 @@ syms_of_haikufns (void) doc: /* SKIP: real doc in xfns.c. */); Vx_sensitive_text_pointer_shape = Qnil; + DEFVAR_BOOL("haiku-pass-control-tab-to-system", + haiku_pass_control_tab_to_system, + doc: /* Whether or not to pass C-TAB to the system. +Setting this variable will cause Emacs to pass C-TAB to the system +(allowing window switching on the Haiku operating system), rather than +intercepting it. */); + haiku_pass_control_tab_to_system = true; + DEFVAR_LISP ("haiku-allowed-ui-colors", Vhaiku_allowed_ui_colors, doc: /* Vector of UI colors that Emacs can look up from the system. If this is set up incorrectly, Emacs can crash when encountering an -- 2.39.2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank you very much for helping me fix this=3D) Cheers, Tor-bj=C3=B6rn Po Lu writes: > Tor-bj=C3=B6rn Claesson writes: > >> Hi! >> >> Thanks for the feedback! >> >> I have updated the patch and commit message, and am happy to fix it >> further if needed. > > Thanks. Three minor (or perhaps trifling) issues: > >> Allow passing C-TAB on to the Haiku operating system, fixing window >> switching when an Emacs frame has focus (Bug#70138). > -- > > Duplicate whitespace. > >> * src/haiku_support.cc (DispatchMessage): conditionally pass message to >> BWindow. >> * src/haiku_support.h: >> * src/haikufns.c (haiku_should_pass_control_tab_to_system): >> Add variable haiku-pass-control-tab-to-system, and c function >> haiku_should_pass_control_tab_to_system. > > C should be capitalized, as should the first word in each sentence. > Please also fill the message to 64 columns; in a vc-log buffer, simply > typing M-q should suffice. > >> + DEFVAR_BOOL("haiku-pass-control-tab-to-system", >> + haiku_pass_control_tab_to_system, >> + doc: /*Whether or not to pass C-TAB to the system. > - >> +Setting this variable will cause Emacs to pass C-TAB to the system >> +(allowing window switching on the Haiku operating system), rather than >> +intercepting it.*/); > - > > Missing whitespace. Otherwise, you're good to go. --=20 Mvh, Tor-bj=C3=B6rn Claesson --=-=-=--