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 11:48:55 +0300 Message-ID: <87cyr6bzfd.fsf@barbar> References: <87sf033omt.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="16888"; 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 10:54:22 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 1rrwNy-00048a-9Z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Apr 2024 10:54:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrwNb-0000mW-3g; Wed, 03 Apr 2024 04:53:59 -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 1rrwNa-0000mH-CV for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 04:53:58 -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 1rrwNa-00033v-4A for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 04:53:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrwNe-0000Iu-B2 for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 04:54:02 -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 08:54:02 +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.17121343951002 (code B ref 70138); Wed, 03 Apr 2024 08:54:02 +0000 Original-Received: (at 70138) by debbugs.gnu.org; 3 Apr 2024 08:53:15 +0000 Original-Received: from localhost ([127.0.0.1]:57010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrwMs-0000G5-EK for submit@debbugs.gnu.org; Wed, 03 Apr 2024 04:53:14 -0400 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:47150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrwMo-0000F2-0g for 70138@debbugs.gnu.org; Wed, 03 Apr 2024 04:53:12 -0400 Original-Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-516a97b3139so3129896e87.2 for <70138@debbugs.gnu.org>; Wed, 03 Apr 2024 01:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712134379; x=1712739179; 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=zzoC6OkxGzFGm5RKsdxtjkDzWUFSoE1Yg4SukI2j4Ak=; b=gNvpFQUnIIZ7iB292koKHSE2CI734Byrz6uWKSo+hcBp2JgDfSr5dNr/c5mUyr6b8B BITcAbJzTVguaBQl5IO89Qn5/0cdqlGkr8Wtfx+iIurAo8ydPPq5Ke73STR3ixWYFYSl MKTy5DRwS+jNVdN3vFP8EIeJI7rE099io0WeQ2t0JO1tjagjgusM+/Ily6yLgZuiJeuu 8CcncTH/CRCLRr9UPRy8HzfHwN6fSE3rLcb4KZ/kHxVTmglaZgbZKUMUjQWo6d80SLyM bC2/b5KyLKKDvvoADkayEh5rDLttuYLxV/UgjeqbRSWUjwPJPlE3G2gmjcKNO7+EqT3h zMUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712134379; x=1712739179; 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=zzoC6OkxGzFGm5RKsdxtjkDzWUFSoE1Yg4SukI2j4Ak=; b=uul+LA8wemVvGnWN75hhsxQVsDfCtAsbx8luAWJUw9c18mvlTxRf10FAj8qGllcuMs DYKHjSLOKffJZotQHovich61vjrRrR5XHdL528bi8GfvLQV+mKLMGpz40aoPEXyHpX5c 2gLA26mrnU6VSceOsydrisJguoLtmpj1M8P93YZ/cjl8Thr1WyiG07uxQHVr58/qoecY zlHC99G2bi3lfloEtPcBpQd/CRebOZ6ueqVgIWM8o7aSsFtnWKTfIv07WmdZnukOMc/S GASAgcHcMGkch0tKDIcxY8+O0Ikl7Jzrr9mxYAHC1I+Otsiy/U5t0AlzI9UflfF4FhN2 qdwA== X-Gm-Message-State: AOJu0YzvhljPVku/eoLpWqzHupR2bTKHH0H3Le9mptvOIGDp3aJeG8Dj nNlebRdWzWk6GCpEJ2jGEhJk+eT148ietFdl06N+FD3aDkLphfmsCH4V6k+K X-Google-Smtp-Source: AGHT+IE4tIoWDdhfEAWuex4S+2FA61DO356KtV3uZQ9vzWRH/fuhiH2w25/q0bt9oHtB6DDXZ8nYMg== X-Received: by 2002:ac2:5445:0:b0:515:9479:a997 with SMTP id d5-20020ac25445000000b005159479a997mr1273791lfn.10.1712134378896; Wed, 03 Apr 2024 01:52:58 -0700 (PDT) Original-Received: from barbar ([194.142.111.196]) by smtp.gmail.com with ESMTPSA id b18-20020ac24112000000b00516ba87176fsm266466lfi.265.2024.04.03.01.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 01:52:58 -0700 (PDT) In-reply-to: <87sf033omt.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:282564 Archived-At: --=-=-= Content-Type: text/plain Hi! Thanks for the feedback! I have updated the patch and commit message, and am happy to fix it further if needed. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-New-variable-haiku-pass-control-tab-to-system.patch >From 3007bb534c36deacbbc667b9eb2989cadde16270 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..00293194a41 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 Cheers, Tor-bj=C3=B6rn Claesson --=-=-=--